Skip to main content
added 15 characters in body
Source Link
YOU
  • 124.6k
  • 34
  • 192
  • 222

Looks like accessing array backwards is slow, but not because of while.

http://jsperf.com/html-canvas-performance/3

same perfperformance with following code for me.

var i = 0, z = e.length;
while(i < z) e[i++] *= 123;

Looks like accessing array backwards is slow, but not because of while.

http://jsperf.com/html-canvas-performance/3

same perf with following code

var i = 0, z = e.length;
while(i < z) e[i++] *= 123;

Looks like accessing array backwards is slow, but not because of while.

http://jsperf.com/html-canvas-performance/3

same performance with following code for me.

var i = 0, z = e.length;
while(i < z) e[i++] *= 123;
deleted 6 characters in body
Source Link
YOU
  • 124.6k
  • 34
  • 192
  • 222

Looks like it is accessing array backwards is slow, but not because of while.

http://jsperf.com/html-canvas-performance/3

same perf with following code

var i = 0, z = e.length;
while(i < z) e[i++] *= 123;

Looks like it is accessing array backwards is slow, but not because of while.

http://jsperf.com/html-canvas-performance/3

same perf with following code

var i = 0, z = e.length;
while(i < z) e[i++] *= 123;

Looks like accessing array backwards is slow, but not because of while.

http://jsperf.com/html-canvas-performance/3

same perf with following code

var i = 0, z = e.length;
while(i < z) e[i++] *= 123;
added 9 characters in body
Source Link
YOU
  • 124.6k
  • 34
  • 192
  • 222

Looks like it is just because ofaccessing array have to initialize backwards is slow, but not because of while.

http://jsperf.com/html-canvas-performance/3

same perf with following code

var i = 0, z = e.length;
while(i < z) e[i++] *= 123;

Looks like it is just because of array have to initialize backwards.

http://jsperf.com/html-canvas-performance/3

same perf with following code

var i = 0, z = e.length;
while(i < z) e[i++] *= 123;

Looks like it is accessing array backwards is slow, but not because of while.

http://jsperf.com/html-canvas-performance/3

same perf with following code

var i = 0, z = e.length;
while(i < z) e[i++] *= 123;
Source Link
YOU
  • 124.6k
  • 34
  • 192
  • 222
Loading