7 ms·
I think I tested very casually some time ago with Go maps and up to like one hundred items the linear search on array was faster than map lookup. Considering th
by SPascareli13 2y ago
I think I tested very casually some time ago with Go maps and up to like one hundred items the linear search on array was faster than map lookup. Considering that many times when we use Maps for convenience they will have less than a hundred items this could be useful.
Unfortunately I don't have the results (or the test code) anymore, but it shouldn't be hard to do again (casually at least).
- hinkley 2y agoTrees can also be useful here but they have some of the same branching problems that hashes do and lists do not.