At work recently I found myself trying to improve the execution time of a JavaScript routine that processed bits of text in chunks of a few characters each.  The text was stored as a JavaScript Array.  To process the text a chunk at a time, the routine performed an Array.slice() to extract a copy of the next chunk, then handed it off to another function for some processing.  This was proving to be very slow and CPU-intensive on IE 6 for large blocks of text; Firefox 1.5 seemed to handle the same data about 10 times faster.

After going through three successively optimized versions of the per-chunk routine, the performance was still unacceptable on IE.  So, my attention turned to the Array.slice()ing.  According to this post, IE 6's garbage collection heuristics are somewhat naive when applied to modern JavaScript-y, AJAX-ian applications.  I thought perhaps the successive slicing of the large array was tripping IE's GC, but not Firefox's.  So rather than slice()ing, I just copied the chunk into a smaller, chunk-size, temporary array each time.  After that change, the routine ran like a champ on IE.

Beware of perhaps unnecessary object/array allocations in JavaScript, especially in loops, if you're targeting IE; you never know when something like this may bite you.