stepheneb/avalanche2d-js — pull request #6 by SethTisue (2011-11-01 13:45:06+00:00)
Title: this doesn't make it faster...?

any idea why? you'd think that not looping over the patches in renderFolderCanvas would have helped. at least, I thought it would.

three guesses:

1) your code repaints the canvas so infrequently that the benchmark is now engine-bound rather than graphics-bound and therefore something that slows down computation in order to speed up rendering causes an overall slowdown rather than an overall speedup

2) somehow the JS engine knows that the pixel array is "tied" to a canvas, and when we update a pixel, slow stuff happens behind the scenes

3) something about my use/nonuse of "this.", "var" etc. isn't optimal for speed

more than one of these could be true. or none.

1 seems likeliest to me.

anyway, not submitting the pull request for actual incorporation, just for your interest.