RESOLVED FIXED Bug 184990
Web Inspector: Canvas tab: Determine isFunction by looking at the prototype
https://bugs.webkit.org/show_bug.cgi?id=184990
Summary Web Inspector: Canvas tab: Determine isFunction by looking at the prototype
Devin Rousso
Reported 2018-04-25 12:51:17 PDT
Instead of maintaining a static list of function calls on the different canvas context types, we can just look at the prototype to determine if a given key resolves to a function.
Attachments
Patch (8.25 KB, patch)
2018-04-25 12:57 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews103 for mac-sierra (2.55 MB, application/zip)
2018-05-01 17:46 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews106 for mac-sierra-wk2 (3.34 MB, application/zip)
2018-05-01 18:26 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews114 for mac-sierra (3.18 MB, application/zip)
2018-05-01 19:23 PDT, EWS Watchlist
no flags
Patch (9.81 KB, patch)
2018-05-01 22:02 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews200 for win-future (12.87 MB, application/zip)
2018-05-02 00:36 PDT, EWS Watchlist
no flags
Devin Rousso
Comment 1 2018-04-25 12:57:34 PDT
EWS Watchlist
Comment 2 2018-05-01 17:46:29 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 3 2018-05-01 17:46:30 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 4 2018-05-01 18:26:39 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 5 2018-05-01 18:26:40 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 6 2018-05-01 19:23:45 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 7 2018-05-01 19:23:46 PDT Comment hidden (obsolete)
Devin Rousso
Comment 8 2018-05-01 22:02:24 PDT
EWS Watchlist
Comment 9 2018-05-02 00:36:17 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 10 2018-05-02 00:36:29 PDT Comment hidden (obsolete)
Devin Rousso
Comment 11 2018-05-02 00:49:02 PDT
Comment on attachment 339287 [details] Archive of layout-test-results from ews200 for win-future Unrelated failure
Blaze Burg
Comment 12 2018-05-03 09:27:34 PDT
Comment on attachment 339276 [details] Patch r=me How often is this code called? Does it affect performance to dynamically look up for every call, rather than using a fixed Set lookup?
Devin Rousso
Comment 13 2018-05-03 16:17:17 PDT
(In reply to Brian Burg from comment #12) > How often is this code called? Does it affect performance to dynamically > look up for every call, rather than using a fixed Set lookup? `WI.RecoringAction.isFunctionForType` is called once per `WI.RecordingAction` (assuming it has been `swizzle()`d), and is called for each value in the `WI.Recording`'s `initialState.attributes`. I think a good middle-ground would be to keep the `WI.RecordingAction._functionNames` object, but have it be filled with values as each action is processed (sort of like a memoization).
Blaze Burg
Comment 14 2018-05-03 16:52:44 PDT
(In reply to Devin Rousso from comment #13) > (In reply to Brian Burg from comment #12) > > How often is this code called? Does it affect performance to dynamically > > look up for every call, rather than using a fixed Set lookup? > `WI.RecoringAction.isFunctionForType` is called once per > `WI.RecordingAction` (assuming it has been `swizzle()`d), and is called for > each value in the `WI.Recording`'s `initialState.attributes`. I think a > good middle-ground would be to keep the `WI.RecordingAction._functionNames` > object, but have it be filled with values as each action is processed (sort > of like a memoization). If you can capture a profile during the initial setup, and you can't see this code, then don't bother optimizing it.
Devin Rousso
Comment 15 2018-05-04 11:23:31 PDT
(In reply to Brian Burg from comment #14) > (In reply to Devin Rousso from comment #13) > > (In reply to Brian Burg from comment #12) > > > How often is this code called? Does it affect performance to dynamically > > > look up for every call, rather than using a fixed Set lookup? > > `WI.RecoringAction.isFunctionForType` is called once per > > `WI.RecordingAction` (assuming it has been `swizzle()`d), and is called for > > each value in the `WI.Recording`'s `initialState.attributes`. I think a > > good middle-ground would be to keep the `WI.RecordingAction._functionNames` > > object, but have it be filled with values as each action is processed (sort > > of like a memoization). > > If you can capture a profile during the initial setup, and you can't see > this code, then don't bother optimizing it. I was able to get a profile of it while recording the canvas on <http://acko.net> and it only took 0.1ms. The worst I've seen so far (100k actions) was 0.9ms. I think it's fine as is.
WebKit Commit Bot
Comment 16 2018-05-04 11:50:36 PDT
Comment on attachment 339276 [details] Patch Clearing flags on attachment: 339276 Committed r231368: <https://trac.webkit.org/changeset/231368>
WebKit Commit Bot
Comment 17 2018-05-04 11:50:38 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 18 2018-05-04 11:52:35 PDT
Note You need to log in before you can comment on or make changes to this bug.