RESOLVED FIXED 200410
[WHLSL] Avoid visiting the full AST in computeDimensions
https://bugs.webkit.org/show_bug.cgi?id=200410
Summary [WHLSL] Avoid visiting the full AST in computeDimensions
Robin Morisset
Reported 2019-08-02 16:40:46 PDT
We only need to look at the attributes of function definitions, nothing else. And currently we spend a couple of milliseconds in computeDimensions.
Attachments
Patch (3.83 KB, patch)
2019-08-02 16:43 PDT, Robin Morisset
no flags
Robin Morisset
Comment 1 2019-08-02 16:43:52 PDT
Created attachment 375466 [details] Patch 2ms -> 0.002ms for that pass.
Myles C. Maxfield
Comment 2 2019-08-02 16:49:07 PDT
Comment on attachment 375466 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375466&action=review > Source/WebCore/Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp:52 > + if (&functionDefinition == &entryPoint) { Can we move this check outside of the nearest for loop?
Robin Morisset
Comment 3 2019-08-02 17:16:43 PDT
(In reply to Myles C. Maxfield from comment #2) > Comment on attachment 375466 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=375466&action=review > > > Source/WebCore/Modules/webgpu/WHLSL/WHLSLComputeDimensions.cpp:52 > > + if (&functionDefinition == &entryPoint) { > > Can we move this check outside of the nearest for loop? Not easily: the loop has two jobs, both computing the dimensions for the entry point and verifying that no function has multiple NumThreads attributes. So we can't just "continue;" in the case where &functionDefinition != &entryPoint.
WebKit Commit Bot
Comment 4 2019-08-02 18:10:49 PDT
Comment on attachment 375466 [details] Patch Clearing flags on attachment: 375466 Committed r248194: <https://trac.webkit.org/changeset/248194>
WebKit Commit Bot
Comment 5 2019-08-02 18:10:51 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 6 2019-08-02 18:11:20 PDT
Note You need to log in before you can comment on or make changes to this bug.