Blogger :
Ajaxian Blog
All posts :
All posts by Ajaxian Blog
Category :
XML
Blogged date : 2008 Jun 05
“innerHTML is 35 times faster than DOM.”
“DOM methods are just as fast!”
This is a constant argument, and statistics hardly help ;)
Laurens Holst of Backbase has taken a detailed look at the issue as he drew up his own benchmark.
People keep mentioning performance as an argument for using innerHTML, citing that article, so I thought I’d go and see what the reason was for the difference between his and my findings. It turns out that the benchmark has some flaws that skew the results very much in favour of innerHTML, which I’ll point out.
- Content is never escaped
- Selective HTML usage
- XML is much faster than HTML
He re-ran the benchmarks on his system using the new browsers and got the following results: