1 comment

[ 0.20 ms ] story [ 18.1 ms ] thread
This makes me think of the Array While hack to transverse faster.

Rather than using a for loop, do the following:

Var i = -1; Var len = array.length. While(++I < Len) { ...}

Uses the fact that CPUs branch predict forward in arrays, and runs faster through the arrays that a for loop which can actually run out of sequence as well.