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

Issue 596763002: Optimize int.parse with a radix. (Closed)

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

Description

Optimize int.parse with a radix. Handles bignums by parsing chunks of of digits into smis, then combining the smi into a (potential) bignum, using smi arithmetic as much as possible. Use the optimized version for radix 10 and 16 too, instead of going to runtime. R=fschneider@google.com Committed: https://code.google.com/p/dart/source/detail?r=40702 Committed: https://code.google.com/p/dart/source/detail?r=40703

Patch Set 1 #

Patch Set 2 : Merge to head. #

Total comments: 2

Patch Set 3 : Add missing return in error handling. #

Total comments: 9

Patch Set 4 : Address comment. #

Patch Set 5 : Avoid using modulo. It's expensive, and the replacement loop will rarely run for more than one or t… #

Patch Set 6 : Update comment. #

Patch Set 7 : Add more tests, just for good measure. #

Patch Set 8 : Revert mis-merged patch that got into this CL by mistake. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -45 lines) Patch
M runtime/lib/string_patch.dart View 1 2 3 4 5 6 7 2 chunks +4 lines, -8 lines 0 comments Download
M sdk/lib/_internal/compiler/js_lib/core_patch.dart View 1 2 3 4 5 6 7 1 chunk +20 lines, -25 lines 0 comments Download
M sdk/lib/core/string.dart View 1 2 3 4 5 6 7 1 chunk +7 lines, -4 lines 0 comments Download
M tests/corelib/string_fromcharcodes_test.dart View 1 2 3 4 5 6 7 2 chunks +10 lines, -8 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
Lasse Reichstein Nielsen
This significantly speeds up parsing with a radix, and works for bignums too. https://codereview.chromium.org/596763002/diff/20001/runtime/lib/integers_patch.dart File ...
6 years, 3 months ago (2014-09-23 11:34:45 UTC) #2
srdjan
DBC https://codereview.chromium.org/596763002/diff/40001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/596763002/diff/40001/runtime/lib/string_patch.dart#newcode268 runtime/lib/string_patch.dart:268: if (codeUnit < 0x85) return false; Is that ...
6 years, 3 months ago (2014-09-24 20:05:35 UTC) #4
Lasse Reichstein Nielsen
https://codereview.chromium.org/596763002/diff/40001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/596763002/diff/40001/runtime/lib/string_patch.dart#newcode268 runtime/lib/string_patch.dart:268: if (codeUnit < 0x85) return false; Ack, probably not ...
6 years, 3 months ago (2014-09-24 20:26:30 UTC) #5
Florian Schneider
https://codereview.chromium.org/596763002/diff/40001/runtime/lib/integers_patch.dart File runtime/lib/integers_patch.dart (right): https://codereview.chromium.org/596763002/diff/40001/runtime/lib/integers_patch.dart#newcode137 runtime/lib/integers_patch.dart:137: result = (result * multiplier) + (sign * smi); ...
6 years, 2 months ago (2014-09-25 11:38:39 UTC) #6
Lasse Reichstein Nielsen
https://codereview.chromium.org/596763002/diff/40001/runtime/lib/integers_patch.dart File runtime/lib/integers_patch.dart (right): https://codereview.chromium.org/596763002/diff/40001/runtime/lib/integers_patch.dart#newcode137 runtime/lib/integers_patch.dart:137: result = (result * multiplier) + (sign * smi); ...
6 years, 2 months ago (2014-09-25 14:37:17 UTC) #7
Florian Schneider
LGTM. Please add test coverage for the radixes if not already present. https://codereview.chromium.org/596763002/diff/40001/runtime/lib/integers_patch.dart File runtime/lib/integers_patch.dart ...
6 years, 2 months ago (2014-09-26 11:57:05 UTC) #8
Lasse Reichstein Nielsen
I have added a significant number of new tests on top of what was already ...
6 years, 2 months ago (2014-09-26 12:03:19 UTC) #9
Lasse Reichstein Nielsen
Committed patchset #7 (id:120001) manually as 40702 (presubmit successful).
6 years, 2 months ago (2014-09-26 12:04:52 UTC) #10
Lasse Reichstein Nielsen
6 years, 2 months ago (2014-09-26 12:13:55 UTC) #11
Message was sent while issue was closed.
Committed patchset #8 (id:140001) manually as 40703 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698