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

Issue 1319453002: Experiment: Switch to code-driven conversion of CSS unit type names.

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

Description

Switch to code-driven conversion of CSS unit type names. The smaller set of CSS unit type names can be resolved without having to go via a temporary string which is then (hashedly) looked up in a map. Instead encode the lookup operation in code, avoiding the allocation of temporary strings and their hashing for each conversion. Loading content from mainstream sites results in this unit type conversion operation being performed somewhere in the [5k, 20k] range. R= BUG=

Patch Set 1 #

Patch Set 2 : case folding #

Patch Set 3 : tighten length checks #

Patch Set 4 : drop redundant namespace prefix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+94 lines, -52 lines) Patch
M Source/core/Init.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M Source/core/css/CSSPrimitiveValue.h View 1 chunk +2 lines, -3 lines 0 comments Download
M Source/core/css/CSSPrimitiveValue.cpp View 1 2 3 2 chunks +88 lines, -47 lines 0 comments Download
M Source/core/css/parser/CSSParserToken.cpp View 1 chunk +4 lines, -1 line 0 comments Download

Messages

Total messages: 3 (1 generated)
sof
timloh@: not asking for a review, but if a change of this nature has some ...
5 years, 3 months ago (2015-08-27 05:32:20 UTC) #2
Timothy Loh
5 years, 3 months ago (2015-08-27 06:05:02 UTC) #3
On 2015/08/27 05:32:20, sof wrote:
> timloh@: not asking for a review, but if a change of this nature has some
> appeal? 
> 
> Noticed a larger amount of small strings being created while stylesheets are
> being parsed. It seems like allocator churn better avoided.

I'd be happy with something along these lines. That said, we need some sort of
unification around this sort of thing, we have too many different ways to parse
strings (make_token_matcher.py, make_element_lookup_trie.py and gperf for
completely generated, as well as custom stuff like this and CSSSelector.cpp
doing a binary search).

Powered by Google App Engine
This is Rietveld 408576698