RESOLVED FIXED 77271
Cut the indirections when accessing CSS properties
https://bugs.webkit.org/show_bug.cgi?id=77271
Summary Cut the indirections when accessing CSS properties
Benjamin Poulain
Reported 2012-01-27 22:38:44 PST
Getting a CSS value (e.g. element.style.position) seems to go through many indirections. From JSCSSStyleDeclaration::getOwnPropertySlot() ->we check if the name is a valid CSS property -->we encode the name cssPropertyName() -->we get the property ID from the name: cssPropertyID() ->if there is and ID, the name is valid, we set the PropertySlot -->From JSCSSStyleDeclaration::nameGetter(), we do exactly the same thing: -->cssPropertyName() to get a valid name -->cssPropertyID() to get the ID -->get the property for real This seems like a lot of indirection. We can at least cut some fat between cssPropertyName() -> cssPropertyID() (some redundancy between those two) Ideally, JSCSSStyleDeclaration::getOwnPropertySlot() should keep a reference to the CSS Property ID, and getting the actual value would be cheap.
Attachments
Patch (7.50 KB, patch)
2012-03-06 17:40 PST, Benjamin Poulain
no flags
Antti Koivisto
Comment 1 2012-02-15 12:55:26 PST
Does this show up in profiles in some benchmark?
Benjamin Poulain
Comment 2 2012-02-15 14:28:22 PST
(In reply to comment #1) > Does this show up in profiles in some benchmark? This shows up in multiple tests of PeaceKeeper. This is related to: -https://bugs.webkit.org/show_bug.cgi?id=77158 -https://bugs.webkit.org/show_bug.cgi?id=74782 which gave us some points already.
Benjamin Poulain
Comment 3 2012-03-06 17:40:32 PST
Benjamin Poulain
Comment 4 2012-03-06 17:40:54 PST
Comment on attachment 130494 [details] Patch wrong bug
Benjamin Poulain
Comment 5 2012-03-09 14:07:28 PST
Closing this meta bug. What is described here is solved. For the performance of setters, we will need work on the CSS Parser.
Note You need to log in before you can comment on or make changes to this bug.