10 ms·
pure algorithm & perf stuff... - exponential unrolled linked list: I don't know what they are called, so I called them that way https://fulmicoton.com/posts/tan
by fulmicoton 4y ago
pure algorithm & perf stuff...
- exponential unrolled linked list: I don't know what they are called, so I called them that way https://fulmicoton.com/posts/tantivy-stacker/ https://fulmicoton.com/posts/tantivy-stacker/.
- radix heap. I actually had to use that data structure on a real use case.
- radix tree. Actually super useful.
- HashMap<String, V> where the string and the value are contiguous in memory. Weirdly I've never seen that one... The hashmap can stores the full hash in its hash table anyway, so false positive are super rare. It will have to check the string anyway... You can improve your locality by keeping the key and the value in the same place in RAM.
just practical stuff, in python, I often use a magic dict defined as follows.
```
from collections import defaultdict
>>> def MagicDict():
... return defaultdict(MagicDict)
```
then you can use your MagicDict as a weird json-like map.
```
c = MagicDict()
c[3]["aaa"][2] = 5
```