wowserhq / wowser

World of Warcraft in the browser using JavaScript and WebGL
MIT License
241 stars 63 forks source link

M2: Basic performance improvements #86

Closed fallenoak closed 8 years ago

fallenoak commented 8 years ago

Replaced several forEach loops with faster for loops

forEach is quite a bit slower in Chrome than a traditional for loop. Until Chrome better optimizes forEach, we probably want to avoid it in any code path that executes frequently.

Interestingly, forEach seems to be fairly comparable to for on Firefox.

Simplified translation value transform

Turns out it's not necessary to incur the expense of cloning the bone to translate it. Rather, simply cloning the bone's position and calling add() on it with the translation vector gets the job done.

timkurvers commented 8 years ago

:tada: