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

Issue 368483004: Avoid unnecessary copying when parsing doubles. (Closed)

Created:
6 years, 5 months ago by Lasse Reichstein Nielsen
Modified:
6 years, 5 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Avoid unnecessary copying when parsing doubles. R=sgjesse@google.com, vegorov@google.com Committed: https://code.google.com/p/dart/source/detail?r=37863

Patch Set 1 #

Patch Set 2 : Fix typo in assert #

Patch Set 3 : Remove overhead. #

Patch Set 4 : Optimize two-byte-string case #

Patch Set 5 : Also use the native parse directly in JSON parsing. #

Total comments: 4

Patch Set 6 : Address comments. #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -51 lines) Patch
M runtime/lib/double.cc View 1 2 3 4 5 1 chunk +12 lines, -15 lines 0 comments Download
M runtime/lib/double_patch.dart View 1 2 3 4 5 1 chunk +8 lines, -25 lines 0 comments Download
M runtime/lib/string_patch.dart View 3 chunks +20 lines, -10 lines 3 comments Download
M runtime/vm/bootstrap_natives.h View 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/object.h View 1 2 5 1 chunk +5 lines, -0 lines 0 comments Download
M runtime/vm/object.cc View 1 2 3 4 5 1 chunk +29 lines, -0 lines 5 comments Download

Messages

Total messages: 8 (0 generated)
Lasse Reichstein Nielsen
6 years, 5 months ago (2014-07-01 08:07:16 UTC) #1
Søren Gjesse
LGTM
6 years, 5 months ago (2014-07-01 08:19:40 UTC) #2
Lasse Reichstein Nielsen
6 years, 5 months ago (2014-07-01 11:18:28 UTC) #3
Vyacheslav Egorov (Google)
lgtm https://codereview.chromium.org/368483004/diff/80001/runtime/lib/double.cc File runtime/lib/double.cc (right): https://codereview.chromium.org/368483004/diff/80001/runtime/lib/double.cc#newcode195 runtime/lib/double.cc:195: // The native function only accepts one-byte strings. ...
6 years, 5 months ago (2014-07-01 11:36:18 UTC) #4
Lasse Reichstein Nielsen
https://codereview.chromium.org/368483004/diff/80001/runtime/lib/double.cc File runtime/lib/double.cc (right): https://codereview.chromium.org/368483004/diff/80001/runtime/lib/double.cc#newcode195 runtime/lib/double.cc:195: // The native function only accepts one-byte strings. The ...
6 years, 5 months ago (2014-07-01 11:54:18 UTC) #5
Lasse Reichstein Nielsen
Committed patchset #6 manually as r37863 (presubmit successful).
6 years, 5 months ago (2014-07-01 11:59:40 UTC) #6
Ivan Posva
Lasse, Thanks for addressing this. Please fix the types and review the backward scanning for ...
6 years, 5 months ago (2014-07-03 19:44:14 UTC) #7
Lasse Reichstein Nielsen
6 years, 5 months ago (2014-07-04 06:46:01 UTC) #8
Message was sent while issue was closed.
https://codereview.chromium.org/368483004/diff/90001/runtime/lib/string_patch...
File runtime/lib/string_patch.dart (right):

https://codereview.chromium.org/368483004/diff/90001/runtime/lib/string_patch...
runtime/lib/string_patch.dart:283: static bool _isTwoByteWhitespace(int
codePoint) {
The "codePoint" argument is really a "codeUnit". I'll rename it for clarity.

https://codereview.chromium.org/368483004/diff/90001/runtime/lib/string_patch...
runtime/lib/string_patch.dart:309: for (; last >= 0; last--) {
Yes. All Unicode white-space are in the basic multilingual plane, so no
surrogate is part of a white-space character.

https://codereview.chromium.org/368483004/diff/90001/runtime/vm/object.cc
File runtime/vm/object.cc (right):

https://codereview.chromium.org/368483004/diff/90001/runtime/vm/object.cc#new...
runtime/vm/object.cc:16916: int length = end - start;
Ack, yes. Will do.

https://codereview.chromium.org/368483004/diff/90001/runtime/vm/object.cc#new...
runtime/vm/object.cc:16926: int ch = str.CharAt(start + i);
Will do.
Didn't know about the CharAtFunc - nice!

Powered by Google App Engine
This is Rietveld 408576698