Bug 77271 - Cut the indirections when accessing CSS properties
Summary: Cut the indirections when accessing CSS properties
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on: 79014 80461
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-27 22:38 PST by Benjamin Poulain
Modified: 2012-03-09 14:07 PST (History)
3 users (show)

See Also:


Attachments
Patch (7.50 KB, patch)
2012-03-06 17:40 PST, Benjamin Poulain
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Poulain 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.
Comment 1 Antti Koivisto 2012-02-15 12:55:26 PST
Does this show up in profiles in some benchmark?
Comment 2 Benjamin Poulain 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.
Comment 3 Benjamin Poulain 2012-03-06 17:40:32 PST
Created attachment 130494 [details]
Patch
Comment 4 Benjamin Poulain 2012-03-06 17:40:54 PST
Comment on attachment 130494 [details]
Patch

wrong bug
Comment 5 Benjamin Poulain 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.