Hiya!
Often lately when I write JS that does something DHTML-ish (i.e. something that animates) I find it runs very slowly on what I would call an average PC (1.5GHz CPU, 512MB RAM). Even slower if testing it in IE.
Does anyone know any good links/resources that deal specifically with optimizing JavaScript code that does fancy things like animations?
I also occassionally find IE hanging before deciding to process JS even on fairly basic DHTML pages (using DOM.... does IE recurse the whole DOM tree before executing functions etc or something?).
Cheers,
d11
JavaScript Optimizations
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
This is my thinking too. A particular page declares an array. That array then has anywhere between zero and 365 items added to it on page load (once-only) (can you guess what it's for?feyd wrote:I've found that it can often have to do with memory allocations being issued and removed. The garbage collection routines seem to be rather poorly implemented in many browsers.
Now that in itself should not be an issue in most languages. For some reason however, once that array has been filled something as simple as a rollover will have a noticable delay in Internet Explorer.... rather odd
Not particularly optimization, but good to know nevertheless: http://del.icio.us/bweirdan/javascript+bug