RESOLVED FIXED 255923
[GLib] Choose amount of painting threads depending on available CPU cores
https://bugs.webkit.org/show_bug.cgi?id=255923
Summary [GLib] Choose amount of painting threads depending on available CPU cores
Adrian Perez
Reported 2023-04-25 08:03:07 PDT
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
Adrian Perez
Comment 1 2023-04-25 08:33:29 PDT
EWS
Comment 2 2023-04-25 10:08:35 PDT
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
Comment 3 2023-04-25 10:09:21 PDT
Note You need to log in before you can comment on or make changes to this bug.