WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
286603
[Results DB] Really slow with large numbers of configurations
https://bugs.webkit.org/show_bug.cgi?id=286603
Summary
[Results DB] Really slow with large numbers of configurations
Sam Sneddon [:gsnedders]
Reported
2025-01-27 17:07:16 PST
https://results.webkit.org/?suite=layout-tests&suite=layout-tests&test=fonts%2Ffont-weight-invalid-crash.html&test=fonts%2Fligature.html&flavor=wk1&recent=false
Both Safari and Chrome are spending 80% of their time within this JS loop:
https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/static/js/timeline.js#L103-L111
I don't quite understand what this is trying to do, but it feels like we need an algorithmic improvement here? The majority of the rest of the time is the single line
https://github.com/WebKit/WebKit/blob/dccfae42bb29bd4bdef052e469f604a9387241c0/Tools/Scripts/libraries/resultsdbpy/resultsdbpy/view/static/js/timeline.js#L139
, because Array.prototype.unshift is O(n) and we have _lots_ of commits. Given scale just ends up with the same length as commits if I'm reading the code correctly, with the same indicies, we can absolutely certainly do better (even just let scale = Array(commits.length).fill({}) would almost certainly be a win, and then interact with scale[i]).
Attachments
firefox profile screenshot
(1.80 MB, image/png)
2025-02-02 21:31 PST
,
Karl Dubost
no flags
Details
firefox network tab
(1.03 MB, image/png)
2025-02-02 21:47 PST
,
Karl Dubost
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Karl Dubost
Comment 1
2025-02-02 21:31:39 PST
Created
attachment 474112
[details]
firefox profile screenshot In Firefox too, it spends around 50s to display the first table then another 15-20s for the second table.
https://share.firefox.dev/3WI57YV
Karl Dubost
Comment 2
2025-02-02 21:47:51 PST
Created
attachment 474113
[details]
firefox network tab The two JSON files are quite huge too.
https://results.webkit.org/api/results/layout-tests/fonts/ligature.html?flavor=wk1&recent=false
7.96MB
https://results.webkit.org/api/results/layout-tests/fonts/font-weight-invalid-crash.html?flavor=wk1&recent=false
5.67 MB And it downloads in total 23MB.
Ahmad Saleem
Comment 3
2025-02-03 08:26:56 PST
From Karl screenshot, it seems we are using HTTP/1.1 as well, can't we use HTTP/2 to alleviate network bottleneck (limited number of connection and one by one)?
Radar WebKit Bug Importer
Comment 4
2025-02-03 08:28:08 PST
<
rdar://problem/144089048
>
Alexey Proskuryakov
Comment 5
2025-02-03 08:43:27 PST
I do not see any evidence in the Network panel that the load is impacted by HTTP/1 limitations. It's probably best to have this bug focused on the algorithmic issue as originally reported.
Sam Sneddon [:gsnedders]
Comment 6
2025-02-03 12:05:25 PST
Indeed; the bottleneck is entirely in the JS we're executing. Certainly there's low-hanging fruit here with network traffic here, but that's really worthy of separate issues (API responses are both slow and uncompressed; the latter is probably easy enough to solve).
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug