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

Unified Diff: runtime/lib/string_patch.dart

Issue 52813002: Fix performance degradation in string buffer benchmarks: concat in native instead of in Dart. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/string_patch.dart
===================================================================
--- runtime/lib/string_patch.dart (revision 29551)
+++ runtime/lib/string_patch.dart (working copy)
@@ -509,23 +509,11 @@
String toLowerCase() native "String_toLowerCase";
// Concatenate ['start', 'end'[ elements of 'strings'. 'strings' must contain
- // String elements. Optimized for OneByteStrings.
+ // String elements. TODO(srdjan): optimize it.
static String _concatRange(List<String> strings, int start, int end) {
if ((end - start) == 1) {
return strings[start];
}
- final numValues = strings.length;
- if ((start == 0) && (end == numValues)) {
- int totalLength = 0;
- for (int i = 0; i < numValues; i++) {
- String s = strings[i];
- if (s._cid != _OneByteString._classId) {
- return _concatRangeNative(strings, start, end);
- }
- totalLength += s.length;
- }
- return _OneByteString._concatAll(strings, totalLength);
- }
return _concatRangeNative(strings, start, end);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698