Bug 255923
| Summary: | [GLib] Choose amount of painting threads depending on available CPU cores | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Adrian Perez <aperez> |
| Component: | WebKit Misc. | Assignee: | Adrian Perez <aperez> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bugs-noreply, magomez, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Linux | ||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=253953 https://bugs.webkit.org/show_bug.cgi?id=251977 |
||
Adrian Perez
In bug #253953 we enabled threaded painting by default for the WPE port,
and in bug #251977 for GTK port when using GTK4. Currently we are using
a single thread, but it may be desirable to make the choice a bit smarter
depending on the amount of available CPU cores.
I did some testing on a Raspberry Pi 4 (four cores), and the biggest
improvement was the change from no threading to one painting thread, then
the changes from 1-to-2 threads and 2-to-4 had less of an impact--but still
worth it. I also did some quick testing in an AMD Epyc box with 64 cores
and even with canvas heavy content couldn't notice any difference from
eight cores onwards; but of course in this case the fact that CPU frequency
is much higher probably is making each thread finish its work faster and
there are diminishing returns.
Probably a reasonable default that would not make WebKit hog the CPU
by spawning lots of threads would be to use half the number of available
cores, limiting the minimum to one and the maximum to eight.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Adrian Perez
Pull request: https://github.com/WebKit/WebKit/pull/13149
EWS
Committed 263378@main (3161dda2cc0e): <https://commits.webkit.org/263378@main>
Reviewed commits have been landed. Closing PR #13149 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/108509892>