I am running the following loop in javascript:
var d =0;
for(var i=0;i<bigarray1.length;i++){
d += bigarray1[i] - bigarray2[i];
}
bigarray1 and bigarray2 are typed javascript arrays. Are there any perf optimizations specific to typed arrays that I can do (eg using reduce etc)
reducewon't be faster, but it would be more readable for a functional programmer.[].reduce()would be a lot slower than a tight loop like that, not to mention that fact that it doesn't run on typedArrays and would therefore require expensive conversion...