[webkit-reviews] review requested: [Bug 30926] Optimizations to Element::getAttribute : [Attachment 42232] patch 4 with better optimization

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 30 14:19:00 PDT 2009


Jens Alfke <snej at chromium.org> has asked  for review:
Bug 30926: Optimizations to Element::getAttribute
https://bugs.webkit.org/show_bug.cgi?id=30926

Attachment 42232: patch 4 with better optimization
https://bugs.webkit.org/attachment.cgi?id=42232&action=review

------- Additional Comments from Jens Alfke <snej at chromium.org>
OK, here is an improved optimization for NamedAttrMap. It runs through the list
once doing equality checks on the prefix-less attributes, and if that fails, if
necessary it runs through again doing the full check.

In Chromium, I saw a 20% speedup in the getAttribute sub-test, and a 3% speedup
in the DOM Attributes test it's part of. Other core DOM tests were not
noticeably affected.
In Safari, there was only a 3% improvement in the getAttribute sub-test and no
noticeable change in the tests.

>From a bit of Shark'ing around, it looks like the difference is because Safari
spends a lot of time in JSC string copying and GC during the getAttribute test,
while Chromium doesn't. So in Safari, the improvement to
Element::getAttribute(String) is lost in the noise. Not sure why the difference
in behavior. That also explains why Chromium is already 50% faster than Safari
on the DOM Attributes test. (It sucks on some of the other tests, though.)


More information about the webkit-reviews mailing list