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.
Pull request: https://github.com/WebKit/WebKit/pull/13149
Committed 263378@main (3161dda2cc0e): <https://commits.webkit.org/263378@main> Reviewed commits have been landed. Closing PR #13149 and removing active labels.
<rdar://problem/108509892>