Bug 145115 - [JSC] Speed up URL encode/decode by using bitmaps instead of strchr().
Summary: [JSC] Speed up URL encode/decode by using bitmaps instead of strchr().
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Andreas Kling
URL:
Keywords: Performance
Depends on: 145206
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-17 23:34 PDT by Andreas Kling
Modified: 2015-05-20 08:31 PDT (History)
5 users (show)

See Also:


Attachments
Patch (6.67 KB, patch)
2015-05-17 23:34 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff
Patch (6.71 KB, patch)
2015-05-18 00:11 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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?