logoalt Hacker News

andsoitis • yesterday at 9:08 PM • 1 reply • view on HN

You can store the strings separately and have the dictionary hold references to them.

Conceptually:

dictionary<i64, StringReference>

             |

             +----> "hello"

             +----> "a much longer string"

             +----> "x"

Replies

MeetingsBrowser • yesterday at 9:14 PM

Isn’t this just re-inventing the index arena pattern, which nullifies much of the benefit over rust?

> Goose code holds typed references where the equivalent Rust holds u32 indices into an arena — and it is where a good share of the benchmark wins come from.

➕ show 1 reply