4 ms·
Very cool project! I think JS is very underrated for quality games. Another "easy" optimization opportunity: don't use .forEach() unless necessary. I noticed i
by leetharris 3y ago
Very cool project! I think JS is very underrated for quality games.
Another "easy" optimization opportunity: don't use .forEach() unless necessary. I noticed it was used in the benchmark.
.forEach() has the overhead of a function call on every iteration, you can't break out of the loop early if needed, and the scoping is different depending on whether or not you use a classical function or an arrow function.