Monday, April 10th, 2006
Dean Edwards and Alex Russell have been noodling on how to speed up DOM work.
Alex started this off with a “janky hack” that uses our favourite
document.getElementById in a naughty way, by grouping elements by one id. His hack includes a cached element version.
Dean grimaced at the non-standardiness of it, but knows that we need faster DOM work. He played with XPath as a solution and his work concluded:
- DOM queries on Firefox seem pretty quick
- XPath is about 150% faster than DOM queries on a Mozilla platform
- XPath is about 1000% faster than DOM queries on an Opera platform
- the expression hack is about 200-400% faster on an IE platform
- Behaviour leaks like a sieve
Posted by Dion Almaer at 5:53 am