I am doing an experiment and attempting to improve the max particle count before frame-rates start to drop in HTML5 Canvas.
I'm using requestAnimationFrame, I'm using drawImage from a canvas as this seems to be the fastest method for rendering images (as tested on jsPerf).
There's a working jsFiddle here: http://fiddle.jshell.net/bewYC/5/
You might have to refresh or re-run a few times to get it to work (no idea why but it just doesn't want to run on the first page load.)
As is, my computer running Chrome 22 can maintain 60FPS with about 5,000 particles. With every step above that, FPS starts to drop. If I remove drawImage() and just calculate the particles' positions, my processor doesn't max out until well over 10X as many particles.
What I want to know: Is there is a faster way to render a large amount of particles (say 40,000 for example) than using a loop with drawImage in it? I especially want to know this about JavaScript/Canvas, but if you only have knowledge about another language such as Java or C#, then please share anyway.