Bug 121499 - Shrink SVGElement::cssPropertyIdForSVGAttributeName and cssPropertyToTypeMap
Summary: Shrink SVGElement::cssPropertyIdForSVGAttributeName and cssPropertyToTypeMap
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-17 09:44 PDT by Darin Adler
Modified: 2013-09-17 10:12 PDT (History)
6 users (show)

See Also:


Attachments
Patch (18.90 KB, patch)
2013-09-17 09:50 PDT, Darin Adler
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2013-09-17 09:44:43 PDT
Shrink SVGElement::cssPropertyIdForSVGAttributeName and cssPropertyToTypeMap
Comment 1 Darin Adler 2013-09-17 09:50:36 PDT
Created attachment 211917 [details]
Patch
Comment 2 Andreas Kling 2013-09-17 09:58:20 PDT
Comment on attachment 211917 [details]
Patch

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

r=me

> Source/WebCore/svg/SVGElement.cpp:149
> +    for (unsigned i = 0; i < WTF_ARRAY_LENGTH(attributeNames); ++i) {
> +        const AtomicString& localName = attributeNames[i]->localName();
> +        map.add(localName.impl(), cssPropertyID(localName));
> +    }

Can we reserve the necessary map capacity up front to avoid rehashing somehow?

> Source/WebCore/svg/SVGElement.cpp:222
> +    for (unsigned i = 0; i < WTF_ARRAY_LENGTH(table); ++i)
> +        map.add(table[i].attributeName.impl(), table[i].type);

Same question.
Comment 3 Darin Adler 2013-09-17 10:12:55 PDT
Committed r155969: <http://trac.webkit.org/changeset/155969>