Bug 94187 - Share the StringImpl the CSS property names
Summary: Share the StringImpl the CSS property names
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Benjamin Poulain
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-15 22:19 PDT by Benjamin Poulain
Modified: 2012-08-17 14:24 PDT (History)
6 users (show)

See Also:


Attachments
Patch (10.93 KB, patch)
2012-08-15 22:41 PDT, Benjamin Poulain
no flags Details | Formatted Diff | Diff
Patch (11.07 KB, patch)
2012-08-16 17:03 PDT, 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-08-15 22:19:21 PDT
We allocate one new StringImpl every time we need a CSS property name.
Comment 1 Benjamin Poulain 2012-08-15 22:41:15 PDT
Created attachment 158713 [details]
Patch
Comment 2 Alexey Proskuryakov 2012-08-16 14:11:02 PDT
Comment on attachment 158713 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=158713&action=review

> Source/WebCore/css/makeprop.pl:141
> +    static AtomicString* propertyStrings = new AtomicString[numCSSProperties]; // Leaked intentionally.

It's not "leaked", it's just never destroyed.

> Source/WebCore/css/makeprop.pl:153
> +    return String(getPropertyNameAtomicString(id).impl());

Why not AtomicString::string()?
Comment 3 Benjamin Poulain 2012-08-16 17:03:08 PDT
Created attachment 158950 [details]
Patch
Comment 4 Benjamin Poulain 2012-08-16 17:03:58 PDT
Addressed Alexey's comments + added perf numbers.

My microbenchmark: http://jsperf.com/getpropertyname-memory-wasting
Comment 5 Alexey Proskuryakov 2012-08-16 17:08:05 PDT
Comment on attachment 158950 [details]
Patch

ok
Comment 6 Benjamin Poulain 2012-08-17 14:24:21 PDT
Comment on attachment 158950 [details]
Patch

Clearing flags on attachment: 158950

Committed r125934: <http://trac.webkit.org/changeset/125934>
Comment 7 Benjamin Poulain 2012-08-17 14:24:25 PDT
All reviewed patches have been landed.  Closing bug.