Bug 145115

Summary: [JSC] Speed up URL encode/decode by using bitmaps instead of strchr().
Product: WebKit Reporter: Andreas Kling <kling>
Component: JavaScriptCoreAssignee: Andreas Kling <kling>
Status: REOPENED ---    
Severity: Normal CC: benjamin, commit-queue, darin, ggaren, kling
Priority: P2 Keywords: Performance
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 145206    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch none

Description Andreas Kling 2015-05-17 23:34:05 PDT
Patch a-comin'
Comment 1 Andreas Kling 2015-05-17 23:34:43 PDT
Created attachment 253304 [details]
Patch
Comment 2 WebKit Commit Bot 2015-05-17 23:36:51 PDT
Attachment 253304 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:139:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:709:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Andreas Kling 2015-05-18 00:11:23 PDT
Created attachment 253305 [details]
Patch
Comment 4 WebKit Commit Bot 2015-05-18 00:14:06 PDT
Attachment 253305 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:139:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
ERROR: Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:709:  Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons.  [readability/comparison_to_zero] [5]
Total errors found: 2 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 WebKit Commit Bot 2015-05-18 10:46:50 PDT
Comment on attachment 253305 [details]
Patch

Clearing flags on attachment: 253305

Committed r184501: <http://trac.webkit.org/changeset/184501>
Comment 6 WebKit Commit Bot 2015-05-18 10:46:54 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Darin Adler 2015-05-19 09:39:40 PDT
Comment on attachment 253305 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=253305&action=review

> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:75
> +        if (c && doNotEscape.get(static_cast<LChar>(c)))

No need for the "c &&" part any more.

> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:139
> +            if (charLen && (u == 0 || u >= 128 || !doNotUnescape.get(static_cast<LChar>(u)))) {

No need for the "u == 0 ||" part any more.

> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:690
> +            if (u && doNotEscape.get(static_cast<LChar>(u)))

No need for the "u &&" part any more.

> Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp:709
> +        } else if (u != 0 && doNotEscape.get(static_cast<LChar>(u)))

No need for the "u != 0 &&" part any more.
Comment 8 Andreas Kling 2015-05-19 21:49:44 PDT
Committed r184613: <http://trac.webkit.org/changeset/184613>
Comment 9 WebKit Commit Bot 2015-05-19 23:03:05 PDT
Re-opened since this is blocked by bug 145206
Comment 10 Darin Adler 2015-05-20 08:31:27 PDT
Oops. I guess I was wrong about not needing the null checks. Are nulls somehow not supported or something?