Chromium Code Reviews
DescriptionAvoid string allocation when parsing CSSPrimitiveValue::UnitType
Currently the CSSPrimitiveValue::fromName function, which parses strings
to unit types, takes a String argument. This means that the CSS parser
needs to allocate a String (since it would only otherwise have a
CSSParserString). This patch avoids this allocation using a generated
switch-statement trie instead.
Generated file: http://paste.ubuntu.com/16652358/
This improves performance of the inline-transform-benchmark test from
https://bugs.chromium.org/p/chromium/issues/detail?id=605792, reducing
the time spent in CSSParserImpl::parseValue by 10%.
Patch originally written by meade@chromium.org:
https://codereview.chromium.org/1938343002
BUG=605792, 606695
Committed: https://crrev.com/a753d727f2d92f67b594312a6710c931b37a49b3
Cr-Commit-Position: refs/heads/master@{#395849}
Patch Set 1 #Patch Set 2 : git cl try #Patch Set 3 : rebase #Messages
Total messages: 15 (8 generated)
|