WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
77158
Speed up the prefix matching of cssPropertyName()
https://bugs.webkit.org/show_bug.cgi?id=77158
Summary
Speed up the prefix matching of cssPropertyName()
Benjamin Poulain
Reported
2012-01-26 15:55:32 PST
The function cssPropertyName() shows up in some benchmarks. Fix the prefix matching before doing
https://bugs.webkit.org/show_bug.cgi?id=74782
Attachments
Patch
(7.02 KB, patch)
2012-01-26 16:19 PST
,
Benjamin Poulain
ggaren
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
Benjamin Poulain
Comment 1
2012-01-26 16:19:53 PST
Created
attachment 124207
[details]
Patch
Geoffrey Garen
Comment 2
2012-01-27 12:53:13 PST
Comment on
attachment 124207
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=124207&action=review
r=me
> Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp:72 > +static inline bool matchesCSSPropertyNamePrefixEnding(const StringImpl& propertyName, const char (&prefix)[prefixCStringLength])
The word "Ending" in this function name confused me. I think it would be better without it: "matchesCSSPropertyNamePrefix".
> Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp:101 > +static PropertyNamePrefix getCSSPropertyNamePrefix(const StringImpl& propertyName)
Your patch does one switch in getCSSPropertyNamePrefix(), then feeds the result into a second switch in cssPropertyName(). It would be more efficient to merge getCSSPropertyNamePrefix() into cssPropertyName(), so you only have to switch once.
Benjamin Poulain
Comment 3
2012-01-27 12:57:50 PST
> The word "Ending" in this function name confused me. I think it would be better without it: "matchesCSSPropertyNamePrefix".
Good point, that is confusing.
> Your patch does one switch in getCSSPropertyNamePrefix(), then feeds the result into a second switch in cssPropertyName(). It would be more efficient to merge getCSSPropertyNamePrefix() into cssPropertyName(), so you only have to switch once.
I did the two switch() for readability. I'll remove it. Thanks for the review :)
Benjamin Poulain
Comment 4
2012-01-27 14:47:54 PST
Committed
r106154
: <
http://trac.webkit.org/changeset/106154
>
Darin Adler
Comment 5
2014-04-24 16:45:26 PDT
Moving all JavaScriptGlue bugs to JavaScriptCore. The JavaScriptGlue framework itself is long gone. And most of the more recent bugs put in this component were put there by people who thought this was for some other aspect of “JavaScript glue” and have nothing to do with the actual original reason for the existence of this component, which was an OS-X-only framework named JavaScriptGlue.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug