About String in Firefox, IE and Opera

I mentioned the LZ77-JavaScript-Compressor early this month. And today I read Alex's "another reason to use Dojo: dojo.string.Builder", and modified a few lines of the codes so that it takes the advent of Firefox's String.

But actually it do not work better as I expected. In firefox it originally takes about 3~3.5s to uncompress about 400k sources from 135k string. After modification, it takes about 2~2.5s. And the originally Array.join method takes about 5s in IE. And finally I test the modified method on Opera 8. I was astonished: it's 0.7~1s, which is my expectation! But the original method takes about 3~3.5s in Opera!

That is to say, Opera's "String += String" is about triple faster than Firefox and about 7x faster than the best way of IE!

Firefox v.s. IE v.s. Opera, and this round's WINNER is Opera.

This entry was posted in JavaScript. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>