15 ms·
Cache is one thing, but also you don't need to repeatedly perform hash functions. Array index lookup is of course far faster than map lookup.
by cnity 4y ago
Cache is one thing, but also you don't need to repeatedly perform hash functions. Array index lookup is of course far faster than map lookup.
- preseinger 4y agoalso doing those map lookups twice per iteration, for some reason
- cnity 4y agoSeems likely to be optimised by the compiler, not sure though.