Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you have a lot of states (postgresql has > 400 keywords to identify), the assembly encoding the switch will be several kb big, so you'll have cache misses.

Perfect hashing trades more computing for less cache misses.

[edit] Also, you shouldn't forget that sparse switch...case aren't O(1).



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: