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.
Replaced several forEach loops with faster for loops
forEach
is quite a bit slower in Chrome than a traditionalfor
loop. Until Chrome better optimizesforEach
, we probably want to avoid it in any code path that executes frequently.Interestingly,
forEach
seems to be fairly comparable tofor
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.