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

Issue 209443005: Add optimized _OneByteString.toLowerCase. (Closed)

Created:
6 years, 9 months ago by Anders Johnsen
Modified:
6 years, 9 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Patch Set 1 #

Total comments: 7

Patch Set 2 : Create unified _ASCII.toLowerCase(Byte). #

Patch Set 3 : Tiny fix. #

Patch Set 4 : Tiny fix. #

Patch Set 5 : Optimize toLowerCase. #

Total comments: 2

Patch Set 6 : Move impl to _OneByteString. #

Total comments: 10

Patch Set 7 : Use table, code from lrn@. #

Patch Set 8 : length == 1 case #

Total comments: 17

Patch Set 9 : Rename. #

Patch Set 10 : Remove lenght == 1 check. #

Patch Set 11 : #

Total comments: 4

Patch Set 12 : Fix test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -9 lines) Patch
M runtime/lib/string_patch.dart View 1 2 3 4 5 6 7 8 9 1 chunk +62 lines, -0 lines 0 comments Download
M sdk/lib/io/http_parser.dart View 1 2 3 4 5 6 4 chunks +11 lines, -9 lines 0 comments Download
A tests/corelib/string_to_lower_case_test.dart View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +19 lines, -0 lines 0 comments Download

Messages

Total messages: 29 (0 generated)
Anders Johnsen
6 years, 9 months ago (2014-03-24 15:39:41 UTC) #1
sra1
On 2014/03/24 15:39:41, Anders Johnsen wrote: Is is possible to get the performance you need ...
6 years, 9 months ago (2014-03-24 17:21:11 UTC) #2
kevmoo
DBC https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart File sdk/lib/io/http_headers.dart (right): https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart#newcode524 sdk/lib/io/http_headers.dart:524: final int aCode = "A".codeUnitAt(0); Is this only ...
6 years, 9 months ago (2014-03-24 17:50:16 UTC) #3
Anders Johnsen
https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart File sdk/lib/io/http_headers.dart (right): https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart#newcode524 sdk/lib/io/http_headers.dart:524: final int aCode = "A".codeUnitAt(0); On 2014/03/24 17:50:16, kevmoo ...
6 years, 9 months ago (2014-03-24 19:02:59 UTC) #4
kevmoo
https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart File sdk/lib/io/http_headers.dart (right): https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart#newcode524 sdk/lib/io/http_headers.dart:524: final int aCode = "A".codeUnitAt(0); On 2014/03/24 19:02:59, Anders ...
6 years, 9 months ago (2014-03-24 19:04:04 UTC) #5
Anders Johnsen
https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart File sdk/lib/io/http_headers.dart (right): https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart#newcode524 sdk/lib/io/http_headers.dart:524: final int aCode = "A".codeUnitAt(0); On 2014/03/24 19:04:05, kevmoo ...
6 years, 9 months ago (2014-03-24 19:05:04 UTC) #6
Søren Gjesse
lgtm, with comments https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart File sdk/lib/io/http_headers.dart (right): https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart#newcode524 sdk/lib/io/http_headers.dart:524: final int aCode = "A".codeUnitAt(0); Yes, ...
6 years, 9 months ago (2014-03-25 07:54:25 UTC) #7
Anders Johnsen
PTAL, unified all of IO for this. https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart File sdk/lib/io/http_headers.dart (right): https://codereview.chromium.org/209443005/diff/1/sdk/lib/io/http_headers.dart#newcode537 sdk/lib/io/http_headers.dart:537: result[i] = ...
6 years, 9 months ago (2014-03-25 13:33:39 UTC) #8
kevmoo
https://codereview.chromium.org/209443005/diff/100001/sdk/lib/io/common.dart File sdk/lib/io/common.dart (right): https://codereview.chromium.org/209443005/diff/100001/sdk/lib/io/common.dart#newcode129 sdk/lib/io/common.dart:129: // - 0x41 is 'A' LOVE the explicit comments. ...
6 years, 9 months ago (2014-03-25 14:38:25 UTC) #9
Anders Johnsen
srdjan: This was originally an attempt to add a ASCII-only toLowerCase, but sra suggested that ...
6 years, 9 months ago (2014-03-25 14:59:51 UTC) #10
Anders Johnsen
https://codereview.chromium.org/209443005/diff/100001/sdk/lib/io/common.dart File sdk/lib/io/common.dart (right): https://codereview.chromium.org/209443005/diff/100001/sdk/lib/io/common.dart#newcode129 sdk/lib/io/common.dart:129: // - 0x41 is 'A' On 2014/03/25 14:38:25, kevmoo ...
6 years, 9 months ago (2014-03-25 15:00:22 UTC) #11
Søren Gjesse
lgtm, but what about toUpperCase? https://codereview.chromium.org/209443005/diff/140001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/140001/runtime/lib/string_patch.dart#newcode781 runtime/lib/string_patch.dart:781: int _nextLowerCase(int offset) { ...
6 years, 9 months ago (2014-03-25 15:28:05 UTC) #12
srdjan
https://codereview.chromium.org/209443005/diff/140001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/140001/runtime/lib/string_patch.dart#newcode784 runtime/lib/string_patch.dart:784: int codeUnit = this.codeUnitAt(offset); final codeUnit https://codereview.chromium.org/209443005/diff/140001/runtime/lib/string_patch.dart#newcode786 runtime/lib/string_patch.dart:786: // ...
6 years, 9 months ago (2014-03-25 15:46:31 UTC) #13
sra1
On 2014/03/25 15:28:05, Søren Gjesse wrote: > lgtm, but what about toUpperCase? I agree, but ...
6 years, 9 months ago (2014-03-25 16:00:16 UTC) #14
sra1
https://codereview.chromium.org/209443005/diff/140001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/140001/runtime/lib/string_patch.dart#newcode827 runtime/lib/string_patch.dart:827: return result; In the case of a one character ...
6 years, 9 months ago (2014-03-25 16:00:32 UTC) #15
Lasse Reichstein Nielsen
I did some tests with various _OneByteString.toLowerCase implementations. The fastest one seems to be table ...
6 years, 9 months ago (2014-03-25 16:34:14 UTC) #16
Anders Johnsen
PTAL, I've pulled in the table-solution lrn@ presented. Performance numbers shows a notable speedup for ...
6 years, 9 months ago (2014-03-25 19:35:50 UTC) #17
srdjan
lgtm https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart#newcode783 runtime/lib/string_patch.dart:783: 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, ...
6 years, 9 months ago (2014-03-25 20:05:36 UTC) #18
Lasse Reichstein Nielsen
https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart#newcode817 runtime/lib/string_patch.dart:817: String _toLowerCaseUpperCaseDetected(int firstUpperCaseIndex) { The "At" doesn't add anything ...
6 years, 9 months ago (2014-03-25 20:10:11 UTC) #19
Anders Johnsen
https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart#newcode783 runtime/lib/string_patch.dart:783: 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, On ...
6 years, 9 months ago (2014-03-25 20:10:45 UTC) #20
Anders Johnsen
https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart#newcode817 runtime/lib/string_patch.dart:817: String _toLowerCaseUpperCaseDetected(int firstUpperCaseIndex) { On 2014/03/25 20:10:12, Lasse Reichstein ...
6 years, 9 months ago (2014-03-25 20:12:26 UTC) #21
srdjan
https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart#newcode817 runtime/lib/string_patch.dart:817: String _toLowerCaseUpperCaseDetected(int firstUpperCaseIndex) { On 2014/03/25 20:10:12, Lasse Reichstein ...
6 years, 9 months ago (2014-03-25 20:14:48 UTC) #22
Anders Johnsen
https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart#newcode830 runtime/lib/string_patch.dart:830: return result[0]; On 2014/03/25 20:14:49, srdjan wrote: > On ...
6 years, 9 months ago (2014-03-25 20:26:06 UTC) #23
Lasse Reichstein Nielsen
https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart#newcode783 runtime/lib/string_patch.dart:783: 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, It ...
6 years, 9 months ago (2014-03-25 20:33:57 UTC) #24
srdjan
https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart#newcode783 runtime/lib/string_patch.dart:783: 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, On ...
6 years, 9 months ago (2014-03-25 20:37:15 UTC) #25
Anders Johnsen
https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart File runtime/lib/string_patch.dart (right): https://codereview.chromium.org/209443005/diff/280001/runtime/lib/string_patch.dart#newcode783 runtime/lib/string_patch.dart:783: 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, On ...
6 years, 9 months ago (2014-03-25 20:38:26 UTC) #26
sra1
lgtm with test fixes if original reviewers are happy https://codereview.chromium.org/209443005/diff/390001/tests/corelib/string_to_lower_case_test.dart File tests/corelib/string_to_lower_case_test.dart (right): https://codereview.chromium.org/209443005/diff/390001/tests/corelib/string_to_lower_case_test.dart#newcode11 tests/corelib/string_to_lower_case_test.dart:11: ...
6 years, 9 months ago (2014-03-25 21:29:12 UTC) #27
Anders Johnsen
Thanks all. I'll land now, and we can iterate this in the future as needed. ...
6 years, 9 months ago (2014-03-25 21:37:48 UTC) #28
Anders Johnsen
6 years, 9 months ago (2014-03-25 21:44:20 UTC) #29
Message was sent while issue was closed.
Committed patchset #12 manually as r34393 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698