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

Issue 51983003: Stop using static arrays for *Tags / *Attrs (Closed)

Created:
7 years, 1 month ago by Inactive
Modified:
6 years, 11 months ago
CC:
blink-reviews, dglazkov+blink, adamk+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Stop using static arrays for *Tags / *Attrs Stop using static arrays for *Tags / *Attrs and construct a Vector dynamically instead. We don't need these static arrays because the callers of get*Attrs() / get*Tags() already make sure those functions are called only once. The objective is to decrease memory usage and enable faster loading of the library on Android by getting rid of relocations. This reduces the number of relocations by 834 according to relinfo. BUG=249746

Patch Set 1 #

Patch Set 2 : Improve generated code #

Total comments: 5

Patch Set 3 : Rebase on master #

Patch Set 4 : Rebase on master #

Total comments: 1

Patch Set 5 : Rebase on master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -30 lines) Patch
M Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl View 1 2 chunks +8 lines, -10 lines 0 comments Download
M Source/build/scripts/templates/MakeQualifiedNames.h.tmpl View 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/parser/HTMLIdentifier.h View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/parser/HTMLIdentifier.cpp View 1 2 3 2 chunks +9 lines, -4 lines 0 comments Download
M Source/core/html/parser/HTMLTreeBuilder.cpp View 1 2 3 4 5 chunks +18 lines, -13 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
Inactive
For reference, here are the diffs for the generated HTMLNames.*: http://pastebin.com/1C6HtTVS http://pastebin.com/d3rKg253 https://codereview.chromium.org/51983003/diff/40001/Source/build/scripts/templates/MakeQualifiedNames.h.tmpl File Source/build/scripts/templates/MakeQualifiedNames.h.tmpl ...
7 years, 1 month ago (2013-10-30 18:35:36 UTC) #1
abarth-chromium
On 2013/10/30 18:35:36, Chris Dumez wrote: > For reference, here are the diffs for the ...
7 years, 1 month ago (2013-10-30 19:26:51 UTC) #2
abarth-chromium
This CL looks good assuming this change is actually a savings. Can you look at ...
7 years, 1 month ago (2013-10-30 19:30:11 UTC) #3
Inactive
On 2013/10/30 19:26:51, abarth wrote: > On 2013/10/30 18:35:36, Chris Dumez wrote: > > For ...
7 years, 1 month ago (2013-10-30 19:31:16 UTC) #4
abarth-chromium
Ok. LGTM, but I'm not super confident here. Ideally we'd get digit to comment.
7 years, 1 month ago (2013-10-30 19:34:13 UTC) #5
Inactive
On 2013/10/30 19:34:13, abarth wrote: > Ok. LGTM, but I'm not super confident here. Ideally ...
7 years, 1 month ago (2013-10-30 19:38:36 UTC) #6
Inactive
On 2013/10/30 19:38:36, Chris Dumez wrote: > On 2013/10/30 19:34:13, abarth wrote: > > Ok. ...
7 years, 1 month ago (2013-10-30 20:16:45 UTC) #7
Inactive
digit@, any opinion on this change?
7 years, 1 month ago (2013-11-01 15:38:26 UTC) #8
digit1
Please let me have a look at the generated binaries. I think the change is ...
7 years, 1 month ago (2013-11-08 16:30:16 UTC) #9
abarth-chromium
7 years, 1 month ago (2013-11-08 18:07:57 UTC) #10
On 2013/11/08 16:30:16, digit1 wrote:
> I think the change is good, but I need confirmation from the compiler to be
100%
> sure :) Assuming this is not part of a performance-sensitive loop, of course.

It's just executed once at startup.

>
https://codereview.chromium.org/51983003/diff/210001/Source/build/scripts/tem...
> File Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl (right):
> 
>
https://codereview.chromium.org/51983003/diff/210001/Source/build/scripts/tem...
> Source/build/scripts/templates/MakeQualifiedNames.cpp.tmpl:31: void
> get{{namespace}}Tags(Vector<const WebCore::QualifiedName*>& tags)
> The Chromium style guide forbids non-constant references. I don't see anything
> related to this topic on http://www.chromium.org/blink/coding-style, so maybe
> avoid them here too?
> 
> I.e. 'use a Vector<const WebCode::QualifiedName*>* tags' parameter and adjust
> callers accordingly.
> 
> It may be that the current style is completely ok within Blink, I don't know
> better :)

We tend to use non-const references in Blink.  We might want to change that
sometime, but that seems sort of out-of-scope for this CL.

Powered by Google App Engine
This is Rietveld 408576698