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

I understand that use case, but in my opinion it would be much cleaner (and speculating faster) to have an 256-slot array...and routing with opcodes[byte.charCodeAt(0)](); or something similar.


Function calls are expensive if they are not optimized. However, the same is true for switch/case trees, and even for JIT'd code (dynamically created functions) ...

In the Javascript world, "Your Mileage May Vary" truly is a motto.




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

Search: