4 ms·
Suggestions: - use if else; - replace "if(stop){return}" with "cancelAnimationFrame"; - don't save data in the html nodes, DOM is slow, use js obje
by ttty 12y ago
Suggestions:
- use if else;
- replace "if(stop){return}" with "cancelAnimationFrame";
- don't save data in the html nodes, DOM is slow, use js object to store data (timespans[currentUrl].textContent = d;).
- no need to use "window.links = ..." you can simply "links = ..."
- milankragujevic 12y agoThanks for the suggestions, I implemented them, and also un-obfuscated and formatted the code. Also, now it's much faster since it doesn't use DOM.
- paulnechifor 12y agoI see you always omit the semicolon for the last statement in a block. Is this a Pascal influence?
- milankragujevic 12y agoNo, I ran the code through an optimizer and checked "remove last semicolon".
- ttty 12y agoThanks for sharing (: as always open source (or almost) comes with suggestions