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

Issue 10897014: Performance improvement for the Dart VM runtime method (Closed)

Created:
8 years, 3 months ago by Tom Ball
Modified:
8 years, 3 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Performance improvement for the Dart VM runtime method Dart_ExternalStringGetPeer. This change is basically an unrolling of the templates that previously defined the method, to reduce the number of handles allocated. This change is supported by the DartStringAccess VM benchmark, which showed a ~20x improvement from the above change. Currently this benchmark focuses on Dart_ExternalStringGetPeer, rather than String performance in general. Please review this carefully. Commented-out is a "NoGCScope no_gc_scope;" line, which when enabled asserts that GC doesn't happen when this function is called. However, one of the tests fails this check, though when I set a breakpoint in gdb before the NoGCScope item is allocated, it's not hit before the assertion fails. I commented out that line, in the hope that more senior reviewers suggest improvements. Committed: https://code.google.com/p/dart/source/detail?r=11534

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 9

Patch Set 4 : #

Total comments: 6

Patch Set 5 : #

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -13 lines) Patch
M runtime/vm/benchmark_test.cc View 1 2 3 4 5 1 chunk +38 lines, -0 lines 0 comments Download
M runtime/vm/dart_api_impl.cc View 1 2 3 4 1 chunk +39 lines, -13 lines 0 comments Download
M runtime/vm/raw_object.h View 1 2 3 4 3 chunks +8 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
Tom Ball
Take 2: dropped previous CL, created new one with correct changes, verified diffs before sending ...
8 years, 3 months ago (2012-08-28 21:42:59 UTC) #1
Ivan Posva
https://chromiumcodereview.appspot.com/10897014/diff/6/runtime/vm/benchmark_test.cc File runtime/vm/benchmark_test.cc (right): https://chromiumcodereview.appspot.com/10897014/diff/6/runtime/vm/benchmark_test.cc#newcode234 runtime/vm/benchmark_test.cc:234: for (int64_t i = 0; i < iterations; i++) ...
8 years, 3 months ago (2012-08-28 22:21:20 UTC) #2
Tom Ball
Thanks for the suggestions, the code is much easier to read. Two issues remain: . ...
8 years, 3 months ago (2012-08-29 00:16:39 UTC) #3
cshapiro
Hi Tom, Can we take a look at the NoGCScope issue together tomorrow? I have ...
8 years, 3 months ago (2012-08-29 00:39:02 UTC) #4
Tom Ball
Thanks for the offer, Carl, I'll take you up on it tomorrow.
8 years, 3 months ago (2012-08-29 00:45:15 UTC) #5
Ivan Posva
LGTM with comments and once the NoGCScope issue is identified. -Ivan https://chromiumcodereview.appspot.com/10897014/diff/9001/runtime/vm/benchmark_test.cc File runtime/vm/benchmark_test.cc (right): ...
8 years, 3 months ago (2012-08-29 05:59:30 UTC) #6
turnidge
DBC ("Drive-By Comment") -turnidge http://codereview.chromium.org/10897014/diff/9001/runtime/vm/raw_object.h File runtime/vm/raw_object.h (right): http://codereview.chromium.org/10897014/diff/9001/runtime/vm/raw_object.h#newcode1129 runtime/vm/raw_object.h:1129: Dart_Handle Dart_ExternalStringGetPeer(Dart_Handle, void**); Does this ...
8 years, 3 months ago (2012-08-29 16:53:35 UTC) #7
Tom Ball
8 years, 3 months ago (2012-08-29 17:20:40 UTC) #8
http://codereview.chromium.org/10897014/diff/9001/runtime/vm/raw_object.h
File runtime/vm/raw_object.h (right):

http://codereview.chromium.org/10897014/diff/9001/runtime/vm/raw_object.h#new...
runtime/vm/raw_object.h:1129: Dart_Handle
Dart_ExternalStringGetPeer(Dart_Handle, void**);
I really, really, really, want it declared? ;-)

It's 1x now, thanks.

http://codereview.chromium.org/10897014/diff/9001/runtime/vm/raw_object.h#new...
runtime/vm/raw_object.h:1137: friend Dart_Handle
Dart_ExternalStringGetPeer(Dart_Handle, void**);
That fails with a syntax error.  According to
http://bytes.com/topic/c/answers/127397-what-proper-syntax-extern-c-friend-vo...,
an explicit extern "C" declaration is required.  Thanks to Todd's review,
though, that declaration is less verbose now.

Powered by Google App Engine
This is Rietveld 408576698