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

Having written a major HTML5 game engine, I've ended up micro-optimizing JS code after small functions really did show up high in profiling measurements. One example: calculating a bounding box from a quad involved code along the lines of Math.min(a, b, c, d) followed by Math.max(a, b, c, d). Replacing that with a tree of ifs to determine both the minimum and maximum at once was faster and moved the bottleneck elsewhere.


You're better off just minimizing your JS if you didn't do that. It's browser render speed that kills you in vidjagames, not function speed.




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

Search: