Bug 62920 - JSONP is unnecessarily slow
Summary: JSONP is unnecessarily slow
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords:
Depends on: 62927
Blocks:
  Show dependency treegraph
 
Reported: 2011-06-17 18:11 PDT by Oliver Hunt
Modified: 2011-06-19 19:58 PDT (History)
2 users (show)

See Also:


Attachments
Patch (27.67 KB, patch)
2011-06-17 18:17 PDT, Oliver Hunt
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2011-06-17 18:11:20 PDT
JSONP is unnecessarily slow
Comment 1 Oliver Hunt 2011-06-17 18:17:16 PDT
Created attachment 97677 [details]
Patch
Comment 2 Gavin Barraclough 2011-06-17 18:37:30 PDT
Comment on attachment 97677 [details]
Patch

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

R+, with changes above.

> Source/JavaScriptCore/interpreter/Interpreter.cpp:766
> +            JSValue baseObject(globalObject);

Please either (1) make this throw the correct errors, or (2) file a bug, add a comment with the bug number here.

> Source/JavaScriptCore/runtime/LiteralParser.cpp:227
> +            return TokAssign;

TokSemi!

> Source/JavaScriptCore/runtime/LiteralParser.cpp:230
> +            while (m_ptr < m_end && (isASCIIAlphanumeric(*m_ptr) || *m_ptr == '_' || *m_ptr == '$'))

I think this while loop is double-checking the identifier start? - not a bug per se, but I think you could add an increment to m_ptr prior to the while & skip a redundant check.
Comment 3 Oliver Hunt 2011-06-17 21:27:28 PDT
Committed r89184: <http://trac.webkit.org/changeset/89184>
Comment 5 Oliver Hunt 2011-06-19 12:50:03 PDT
Committed r89219: <http://trac.webkit.org/changeset/89219>
Comment 6 Ryosuke Niwa 2011-06-19 19:49:37 PDT
fast/workers/worker-script-error.html is failing on all bots:
http://build.webkit.org/results/SnowLeopard%20Intel%20Release%20(Tests)/r89219%20(30527)/fast/workers/worker-script-error-pretty-diff.html

-PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
-PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
+PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 0.
+PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 0.

This is change intentional?
Comment 7 Oliver Hunt 2011-06-19 19:58:29 PDT
(In reply to comment #6)
> fast/workers/worker-script-error.html is failing on all bots:
> http://build.webkit.org/results/SnowLeopard%20Intel%20Release%20(Tests)/r89219%20(30527)/fast/workers/worker-script-error-pretty-diff.html
> 
> -PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
> -PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 1.
> +PASS: onerror invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 0.
> +PASS: event listener invoked for a script that has script error 'ReferenceError: Can't find variable: foo' at line 0.
> 
> This is change intentional?

No. fixed.