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

Issue 1868803002: Use symbols when looking up fields in a class (Closed)

Created:
4 years, 8 months ago by hausner
Modified:
4 years, 8 months ago
Reviewers:
siva, sra1
CC:
reviews_dartlang.org, vm-dev_dartlang.org, Ivan Posva
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Use symbols when looking up fields in a class The slow string comparison is only necessary when looking up non-symbols or untangled private names. Compiling all of dart2js seems to be about 1% faster, but it's really in the noise. BUG= R=asiva@google.com Committed: https://github.com/dart-lang/sdk/commit/425b9a36b9075c3bf5269575ead9d041699a4f36

Patch Set 1 #

Patch Set 2 : Cleanup #

Patch Set 3 : #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+106 lines, -43 lines) Patch
M runtime/lib/math.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/lib/mirrors.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 3 chunks +3 lines, -3 lines 0 comments Download
M runtime/vm/debugger.cc View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/exceptions.cc View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/guard_field_test.cc View 1 chunk +2 lines, -1 line 0 comments Download
M runtime/vm/intrinsifier_arm.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/intrinsifier_arm64.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/intrinsifier_ia32.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/intrinsifier_mips.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/intrinsifier_x64.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M runtime/vm/object.h View 1 chunk +3 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 4 chunks +75 lines, -20 lines 4 comments Download
M runtime/vm/parser.cc View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/parser_test.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M runtime/vm/regexp_assembler_ir.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 10 (4 generated)
hausner
4 years, 8 months ago (2016-04-06 23:39:15 UTC) #3
siva
lgtm https://chromiumcodereview.appspot.com/1868803002/diff/40001/runtime/vm/object.cc File runtime/vm/object.cc (right): https://chromiumcodereview.appspot.com/1868803002/diff/40001/runtime/vm/object.cc#newcode4190 runtime/vm/object.cc:4190: return field.raw(); Not sure if it is worth ...
4 years, 8 months ago (2016-04-07 22:51:30 UTC) #4
hausner
Committed patchset #3 (id:40001) manually as 425b9a36b9075c3bf5269575ead9d041699a4f36 (presubmit successful).
4 years, 8 months ago (2016-04-07 23:36:40 UTC) #6
hausner
Thank you. https://chromiumcodereview.appspot.com/1868803002/diff/40001/runtime/vm/object.cc File runtime/vm/object.cc (right): https://chromiumcodereview.appspot.com/1868803002/diff/40001/runtime/vm/object.cc#newcode4190 runtime/vm/object.cc:4190: return field.raw(); On 2016/04/07 22:51:30, siva wrote: ...
4 years, 8 months ago (2016-04-07 23:37:03 UTC) #7
sra1
https://chromiumcodereview.appspot.com/1868803002/diff/40001/runtime/vm/object.cc File runtime/vm/object.cc (right): https://chromiumcodereview.appspot.com/1868803002/diff/40001/runtime/vm/object.cc#newcode9477 runtime/vm/object.cc:9477: name.CharAt(3) == ':')); Testing ':' before 'g' / 's' ...
4 years, 8 months ago (2016-04-08 20:30:06 UTC) #9
hausner
4 years, 8 months ago (2016-04-08 20:41:20 UTC) #10
Message was sent while issue was closed.
https://chromiumcodereview.appspot.com/1868803002/diff/40001/runtime/vm/objec...
File runtime/vm/object.cc (right):

https://chromiumcodereview.appspot.com/1868803002/diff/40001/runtime/vm/objec...
runtime/vm/object.cc:9477: name.CharAt(3) == ':'));
On 2016/04/08 20:30:06, sra1 wrote:
> Testing ':' before 'g' / 's' will fail faster.

The test (name.CharAt(4) == '_') eliminates practically all non-getter and
non-setter names. I would not lose sleep over this :)

Powered by Google App Engine
This is Rietveld 408576698