3 ms·
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 ex
by AshleysBrain 12y ago
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.
- ulisesrmzroche 12y agoYou'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.