Thursday, June 5th, 2008
“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:
Posted by Dion Almaer at 11:03 am