Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(240)

Issue 2002383002: Avoid string allocation when parsing CSSPrimitiveValue::UnitType (Closed)

Created:
4 years, 7 months ago by Timothy Loh
Modified:
4 years, 7 months ago
CC:
darktears, apavlov+blink_chromium.org, blink-reviews, blink-reviews-css, chromium-reviews, dglazkov+blink, rwlbuis
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Avoid 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+180 lines, -57 lines) Patch
A third_party/WebKit/Source/build/scripts/make_css_primitive_value_unit_trie.py View 1 chunk +35 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/build/scripts/templates/CSSPrimitiveValueUnitTrie.cpp.tmpl View 1 1 chunk +35 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/BUILD.gn View 3 chunks +26 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/CoreInitializer.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/core.gypi View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/core_generated.gyp View 1 chunk +19 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/core_generated.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp View 2 chunks +0 lines, -53 lines 0 comments Download
A third_party/WebKit/Source/core/css/CSSPrimitiveValueUnitTrie.h View 1 chunk +17 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/css/CSSPrimitiveValueUnits.in View 1 chunk +29 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/css/cssom/CSSAngleValue.cpp View 1 chunk +6 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/cssom/CSSLengthValue.cpp View 1 2 2 chunks +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/css/parser/CSSParserToken.cpp View 2 chunks +6 lines, -1 line 0 comments Download

Messages

Total messages: 15 (8 generated)
Timothy Loh
Uploading this since meade@ is OOO (although since 52 just branched I guess we could've ...
4 years, 7 months ago (2016-05-24 07:21:12 UTC) #2
alancutter (OOO until 2018)
lgtm.
4 years, 7 months ago (2016-05-25 07:07:11 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2002383002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2002383002/20001
4 years, 7 months ago (2016-05-25 07:17:40 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: ios-device on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds/11037) win8_chromium_ng on tryserver.chromium.win (JOB_FAILED, ...
4 years, 7 months ago (2016-05-25 07:21:27 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2002383002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2002383002/40001
4 years, 7 months ago (2016-05-25 07:45:58 UTC) #11
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 7 months ago (2016-05-25 10:02:49 UTC) #13
commit-bot: I haz the power
4 years, 7 months ago (2016-05-25 10:05:03 UTC) #15
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/a753d727f2d92f67b594312a6710c931b37a49b3
Cr-Commit-Position: refs/heads/master@{#395849}

Powered by Google App Engine
This is Rietveld 408576698