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

Issue 172543003: Improved JavaScript performance for https://codereview.chromium.org//171773003 (Closed)

Created:
6 years, 10 months ago by sra1
Modified:
6 years, 10 months ago
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Visibility:
Public.

Description

Improved performance for https://codereview.chromium.org//171773003 This version is 5x-8x faster than https://codereview.chromium.org//171773003 when timed on s.padLeft(6, '0') where s is 1, 3 or 7 characters. 5x for jsshell, 8x for v8.

Patch Set 1 : #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+98 lines, -109 lines) Patch
M runtime/lib/string_patch.dart View 7 chunks +40 lines, -58 lines 0 comments Download
M sdk/lib/_internal/lib/js_string.dart View 1 chunk +15 lines, -19 lines 3 comments Download
M sdk/lib/core/string.dart View 1 chunk +25 lines, -14 lines 0 comments Download
M tests/corelib/string_test.dart View 3 chunks +18 lines, -18 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Lasse Reichstein Nielsen
https://codereview.chromium.org/172543003/diff/30001/sdk/lib/_internal/lib/js_string.dart File sdk/lib/_internal/lib/js_string.dart (right): https://codereview.chromium.org/172543003/diff/30001/sdk/lib/_internal/lib/js_string.dart#newcode236 sdk/lib/_internal/lib/js_string.dart:236: times = JS('JSUInt31', '# >>> 1', times); What if ...
6 years, 10 months ago (2014-02-20 06:45:08 UTC) #1
Lasse Reichstein Nielsen
https://codereview.chromium.org/172543003/diff/30001/sdk/lib/_internal/lib/js_string.dart File sdk/lib/_internal/lib/js_string.dart (right): https://codereview.chromium.org/172543003/diff/30001/sdk/lib/_internal/lib/js_string.dart#newcode230 sdk/lib/_internal/lib/js_string.dart:230: if (0 >= times) return ''; // Unnecessary but ...
6 years, 10 months ago (2014-02-20 06:51:33 UTC) #2
Lasse Reichstein Nielsen
6 years, 10 months ago (2014-02-20 06:58:27 UTC) #3
Lasse Reichstein Nielsen
6 years, 10 months ago (2014-02-20 11:50:31 UTC) #4
I merged this into my CL, added a test for too large numbers (throws an
OutOfMemoryError if times > 0xFFFFFFFF && this.isNotEmpty).

Feel free to optimize the test or reduce the range of valid "times". All JS
implementations will hit OOM long before that value.

Powered by Google App Engine
This is Rietveld 408576698