logoalt Hacker News

jeffbeeyesterday at 3:08 PM2 repliesview on HN

It's also the case that performance of a hashmap, or anything, in a small-scale benchmark may not reflect the performance in a large system that does things other than manage maps. There are side effects like how many icache lines are visited during a map operation. These don't hurt microbenchmarks but they can matter in real systems. It may not be completely pointless to microbenchmark a data structure but it can be ultimately misleading.


Replies

yxhuvudyesterday at 7:14 PM

Also it is very easy to find situations where hash table lookups dominate a measurement, but where the answer isn't to make the lookup faster but to make fewer lookups.

show 1 reply
menaerusyesterday at 5:33 PM

Totally. It's funny how many people do not actually realize this and get stuck in cargo-cult mindset forever, no matter the years of experience.