Bug 156943 - We don't have to parse a function's parameters every time if the function is in the source provider cache
Summary: We don't have to parse a function's parameters every time if the function is ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Saam Barati
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-22 18:58 PDT by Saam Barati
Modified: 2016-04-25 12:08 PDT (History)
13 users (show)

See Also:


Attachments
WIP (21.17 KB, patch)
2016-04-22 19:39 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
WIP (20.74 KB, patch)
2016-04-23 10:59 PDT, Saam Barati
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews100 for mac-yosemite (670.56 KB, application/zip)
2016-04-23 11:35 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (673.15 KB, application/zip)
2016-04-23 11:38 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews124 for ios-simulator-wk2 (608.87 KB, application/zip)
2016-04-23 11:43 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews116 for mac-yosemite (714.41 KB, application/zip)
2016-04-23 11:45 PDT, Build Bot
no flags Details
WIP (21.20 KB, patch)
2016-04-23 12:03 PDT, Saam Barati
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (796.84 KB, application/zip)
2016-04-23 12:48 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (769.95 KB, application/zip)
2016-04-23 12:51 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews121 for ios-simulator-wk2 (632.04 KB, application/zip)
2016-04-23 12:55 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews113 for mac-yosemite (852.96 KB, application/zip)
2016-04-23 13:01 PDT, Build Bot
no flags Details
WIP (25.87 KB, patch)
2016-04-23 14:57 PDT, Saam Barati
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-yosemite (804.24 KB, application/zip)
2016-04-23 15:41 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews104 for mac-yosemite-wk2 (820.59 KB, application/zip)
2016-04-23 15:43 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews114 for mac-yosemite (869.38 KB, application/zip)
2016-04-23 15:57 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews122 for ios-simulator-wk2 (605.17 KB, application/zip)
2016-04-23 16:01 PDT, Build Bot
no flags Details
WIP (27.59 KB, patch)
2016-04-24 01:06 PDT, Saam Barati
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews102 for mac-yosemite (813.29 KB, application/zip)
2016-04-24 01:50 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews105 for mac-yosemite-wk2 (935.71 KB, application/zip)
2016-04-24 01:53 PDT, Build Bot
no flags Details
WIP (35.45 KB, patch)
2016-04-24 16:10 PDT, Saam Barati
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews101 for mac-yosemite (782.82 KB, application/zip)
2016-04-24 16:54 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews106 for mac-yosemite-wk2 (804.44 KB, application/zip)
2016-04-24 16:57 PDT, Build Bot
no flags Details
Archive of layout-test-results from ews113 for mac-yosemite (680.44 KB, application/zip)
2016-04-24 16:57 PDT, Build Bot
no flags Details
WIP (33.18 KB, patch)
2016-04-24 18:29 PDT, Saam Barati
no flags Details | Formatted Diff | Diff
patch (37.76 KB, patch)
2016-04-24 23:20 PDT, Saam Barati
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Saam Barati 2016-04-22 18:58:45 PDT
If I can get this to work nicely, it's probably a 1-2% octane-jquery speedup.
Our code used to be weird regarding always parsing parameters. We didn't properly store things
in the cache in the case of a default parameter value being a function that closes over variables.
We got this right before just by luck because we always parse a function's
parameters even if it's in the cache. I need to rework our parser to properly
store closed variables in the cache and then I think this should work.
Comment 1 Saam Barati 2016-04-22 19:39:52 PDT
Created attachment 277131 [details]
WIP

I'm pretty sure this works. I'm thinking about other ways that would be cleaner to get the variables
that are closed over by the functions in the default parameter values in the function's parameter list.
Comment 2 Saam Barati 2016-04-22 19:40:54 PDT
These are the results I'm seeing on code load

VMs tested:
"og" at /Volumes/Data/WK/a/OpenSource/WebKitBuild/Release/jsc (r199867)
"change" at /Volumes/Data/WK/b/OpenSource/WebKitBuild/Release/jsc (r199867)

Collected 14 samples per benchmark/VM, with 14 VM invocations per benchmark. Emitted a call to
gc() between sample measurements. Used 1 benchmark iteration per VM invocation for warm-up. Used
the jsc-specific preciseTime() function to get microsecond-level timing. Reporting benchmark
execution times with 95% confidence intervals in milliseconds.

                            og                      change                                      

closure              0.50697+-0.00364          0.50263+-0.00323       
jquery               6.44294+-0.05266    ^     6.28855+-0.03858       ^ definitely 1.0245x faster

<geometric>          1.80728+-0.01199    ^     1.77781+-0.00786       ^ definitely 1.0166x faster
Comment 3 Saam Barati 2016-04-23 10:59:45 PDT
Created attachment 277152 [details]
WIP

rebaselined
Comment 4 WebKit Commit Bot 2016-04-23 11:01:39 PDT
Attachment 277152 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/Parser.h:667:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 5 Build Bot 2016-04-23 11:35:11 PDT
Comment on attachment 277152 [details]
WIP

Attachment 277152 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1208568

Number of test failures exceeded the failure limit.
Comment 6 Build Bot 2016-04-23 11:35:16 PDT
Created attachment 277153 [details]
Archive of layout-test-results from ews100 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 7 Build Bot 2016-04-23 11:38:08 PDT
Comment on attachment 277152 [details]
WIP

Attachment 277152 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1208575

Number of test failures exceeded the failure limit.
Comment 8 Build Bot 2016-04-23 11:38:12 PDT
Created attachment 277154 [details]
Archive of layout-test-results from ews106 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 9 Build Bot 2016-04-23 11:43:33 PDT
Comment on attachment 277152 [details]
WIP

Attachment 277152 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1208572

Number of test failures exceeded the failure limit.
Comment 10 Build Bot 2016-04-23 11:43:38 PDT
Created attachment 277155 [details]
Archive of layout-test-results from ews124 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews124  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 11 Build Bot 2016-04-23 11:45:15 PDT
Comment on attachment 277152 [details]
WIP

Attachment 277152 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1208576

Number of test failures exceeded the failure limit.
Comment 12 Build Bot 2016-04-23 11:45:20 PDT
Created attachment 277156 [details]
Archive of layout-test-results from ews116 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews116  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 13 Saam Barati 2016-04-23 12:03:54 PDT
Created attachment 277157 [details]
WIP

try to fix some bugs
Comment 14 WebKit Commit Bot 2016-04-23 12:04:58 PDT
Attachment 277157 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/Parser.h:667:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 1 in 3 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 15 Build Bot 2016-04-23 12:47:57 PDT
Comment on attachment 277157 [details]
WIP

Attachment 277157 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1208803

New failing tests:
js/dom/script-start-end-locations.html
Comment 16 Build Bot 2016-04-23 12:48:01 PDT
Created attachment 277158 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 17 Build Bot 2016-04-23 12:51:03 PDT
Comment on attachment 277157 [details]
WIP

Attachment 277157 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1208806

New failing tests:
js/dom/script-start-end-locations.html
Comment 18 Build Bot 2016-04-23 12:51:07 PDT
Created attachment 277159 [details]
Archive of layout-test-results from ews106 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 19 Build Bot 2016-04-23 12:55:51 PDT
Comment on attachment 277157 [details]
WIP

Attachment 277157 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1208805

New failing tests:
js/dom/script-start-end-locations.html
Comment 20 Build Bot 2016-04-23 12:55:53 PDT
Created attachment 277160 [details]
Archive of layout-test-results from ews121 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews121  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 21 Build Bot 2016-04-23 13:01:27 PDT
Comment on attachment 277157 [details]
WIP

Attachment 277157 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1208811

New failing tests:
js/dom/script-start-end-locations.html
Comment 22 Build Bot 2016-04-23 13:01:31 PDT
Created attachment 277161 [details]
Archive of layout-test-results from ews113 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 23 Saam Barati 2016-04-23 14:57:12 PDT
Created attachment 277165 [details]
WIP

try to fix failing tests
Comment 24 WebKit Commit Bot 2016-04-23 14:58:57 PDT
Attachment 277165 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/Parser.h:667:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 1 in 5 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 25 Build Bot 2016-04-23 15:41:31 PDT
Comment on attachment 277165 [details]
WIP

Attachment 277165 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1209393

New failing tests:
inspector/debugger/breakpoint-columns.html
js/dom/script-start-end-locations.html
Comment 26 Build Bot 2016-04-23 15:41:36 PDT
Created attachment 277166 [details]
Archive of layout-test-results from ews102 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 27 Build Bot 2016-04-23 15:43:49 PDT
Comment on attachment 277165 [details]
WIP

Attachment 277165 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1209395

New failing tests:
inspector/debugger/breakpoint-columns.html
js/dom/script-start-end-locations.html
Comment 28 Build Bot 2016-04-23 15:43:54 PDT
Created attachment 277167 [details]
Archive of layout-test-results from ews104 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 29 Build Bot 2016-04-23 15:57:42 PDT
Comment on attachment 277165 [details]
WIP

Attachment 277165 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1209407

New failing tests:
js/dom/script-start-end-locations.html
Comment 30 Build Bot 2016-04-23 15:57:48 PDT
Created attachment 277168 [details]
Archive of layout-test-results from ews114 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews114  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 31 Build Bot 2016-04-23 16:01:34 PDT
Comment on attachment 277165 [details]
WIP

Attachment 277165 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/1209416

New failing tests:
js/dom/script-start-end-locations.html
Comment 32 Build Bot 2016-04-23 16:01:39 PDT
Created attachment 277169 [details]
Archive of layout-test-results from ews122 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews122  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.4
Comment 33 Saam Barati 2016-04-24 01:06:14 PDT
Created attachment 277185 [details]
WIP
Comment 34 WebKit Commit Bot 2016-04-24 01:08:32 PDT
Attachment 277185 [details] did not pass style-queue:


ERROR: Source/JavaScriptCore/parser/Parser.h:667:  One line control clauses should not use braces.  [whitespace/braces] [4]
Total errors found: 1 in 6 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 35 Build Bot 2016-04-24 01:50:14 PDT
Comment on attachment 277185 [details]
WIP

Attachment 277185 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1211507

New failing tests:
inspector/debugger/breakpoint-columns.html
Comment 36 Build Bot 2016-04-24 01:50:18 PDT
Created attachment 277186 [details]
Archive of layout-test-results from ews102 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews102  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 37 Build Bot 2016-04-24 01:53:08 PDT
Comment on attachment 277185 [details]
WIP

Attachment 277185 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1211514

New failing tests:
inspector/debugger/breakpoint-columns.html
Comment 38 Build Bot 2016-04-24 01:53:13 PDT
Created attachment 277187 [details]
Archive of layout-test-results from ews105 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 39 Saam Barati 2016-04-24 16:10:17 PDT
Created attachment 277201 [details]
WIP
Comment 40 Build Bot 2016-04-24 16:54:16 PDT
Comment on attachment 277201 [details]
WIP

Attachment 277201 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/1214737

New failing tests:
js/dom/line-column-numbers.html
Comment 41 Build Bot 2016-04-24 16:54:20 PDT
Created attachment 277203 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 42 Build Bot 2016-04-24 16:57:02 PDT
Comment on attachment 277201 [details]
WIP

Attachment 277201 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/1214742

New failing tests:
js/dom/line-column-numbers.html
Comment 43 Build Bot 2016-04-24 16:57:06 PDT
Created attachment 277204 [details]
Archive of layout-test-results from ews106 for mac-yosemite-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-yosemite-wk2  Platform: Mac OS X 10.10.5
Comment 44 Build Bot 2016-04-24 16:57:08 PDT
Comment on attachment 277201 [details]
WIP

Attachment 277201 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/1214725

Number of test failures exceeded the failure limit.
Comment 45 Build Bot 2016-04-24 16:57:13 PDT
Created attachment 277205 [details]
Archive of layout-test-results from ews113 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 46 Saam Barati 2016-04-24 18:29:21 PDT
Created attachment 277208 [details]
WIP

I think this one might actually work.
I've spent a long time debugging until I realized that the lexer only selectively selects which token to set lineStartOffset for.
That was painful.
Comment 47 Saam Barati 2016-04-24 23:20:41 PDT
Created attachment 277223 [details]
patch
Comment 48 WebKit Commit Bot 2016-04-25 12:08:28 PDT
Comment on attachment 277223 [details]
patch

Clearing flags on attachment: 277223

Committed r200038: <http://trac.webkit.org/changeset/200038>
Comment 49 WebKit Commit Bot 2016-04-25 12:08:37 PDT
All reviewed patches have been landed.  Closing bug.