Sure. It may be beyond your current scope, but it is also possible to have one 
big linear buffer (like a long string with NUL (\0) separators) paired with an 
even denser "set like" hash table storing (byte offset, strlen) pairs. So, just 
two distinct memory regions with the offset operating as an alias. This is how 
one would more traditionally implement interning. You might need to impl your 
own hash table for that (since you present it a string query but it figures out 
a byte offset). Then the byte offset would operate as an address. Word numbers 
are a bit smaller which can occasionally pay off.

Also, I just added [an 
example](https://github.com/c-blake/adix/blob/master/tests/wf.nim) with some 
but not all of these ideas present for a little parallel "word frequency" tool. 
If you have trouble with it/want help, it's probably best to raise an issue or 
discussion topic over at the `adix` repo, though.

Reply via email to