Sorry dude, I think I just broke your app with a single line of JS..
setInterval(function() {jQuery("#theimage").click()},1);
You can break any web app with a single line of javascript.
Your link gives a 502
Re:Optimizing AngularJS
by DigitalSea on Friday November 01, 2013 @06:32AM
(#6652852)
Haha yeah, it received 12,000 clicks in the space of about 1 hour or so which took it down. Node is good, but it couldn't handle that many clicks.
Isn't that about 3 clicks a second? Was there a database issue?
Re:Optimizing AngularJS
by DigitalSea on Friday November 01, 2013 @06:02PM
(#6656790)
It seemed the server at times would get hammered and there would be a kind of race condition happening causing a variable for the clicks I am incrementing to have a value of undefined at times (no idea). I was using nodemon instead of forever.js, so when the error would occur, it wouldn't restart. It's all good now.
Re:Optimizing AngularJS
by senorprogrammer on Friday November 01, 2013 @09:49AM
(#6653672)
On average. I suspect his clicks were bursty.
Inspecting the page will yield a click map where I am displaying all 53,000 mouse clicks inside of a map. As you can see I am using canvas now, but before that I was inserting them into the page and believe it or not, using documentFragment it was amazingly fast.
The reason I switched to canvas because performance on mobile was poor. 53,000+ elements rendered by Javascript on desktop didn't cause any fuss though, using documentFragment makes all the difference. Keep in mind, documentFragment really only shines when you are inserting 1000 plus elements into the page at once. One reflow against many reflows is going to cause you a lot of headaches.