Bug 32677

Summary: [Qt] Avoid QThread overhead on Unix platforms
Product: WebKit Reporter: Benjamin Poulain <benjamin>
Component: WebKit QtAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: benjamin, hausmann, tonikitoo
Priority: P2 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Use pthread instead of QThread on Unix none

Benjamin Poulain
Reported 2009-12-17 12:09:15 PST
QThread has a non-negligible overhead. On Linux devices, this is noticeable, because of the accesses to WTF::currentThread() for which QThread's TLS is slower to access.
Attachments
Use pthread instead of QThread on Unix (1.58 KB, patch)
2009-12-17 12:11 PST, Benjamin Poulain
no flags
Benjamin Poulain
Comment 1 2009-12-17 12:11:14 PST
Created attachment 45100 [details] Use pthread instead of QThread on Unix We don't use any feature of QThread, and Webkit already provide a good implementation of pthread. We can use the Webkit implementation on the relevant platform.
Antonio Gomes
Comment 2 2009-12-17 13:10:17 PST
it seems a nice change. benjamin , have you measured the gains ?
Benjamin Poulain
Comment 3 2009-12-18 02:51:21 PST
(In reply to comment #2) > it seems a nice change. > > benjamin , have you measured the gains ? Here is is, it is for a reduced cycler test on a N900: With pthread: 79,889 msec per iteration (total: 79889, iterations: 1) 79,288 msec per iteration (total: 79288, iterations: 1) 78,139 msec per iteration (total: 78139, iterations: 1) Avg: 79105 with QThread: 80,960 msec per iteration (total: 80960, iterations: 1) 80,543 msec per iteration (total: 80543, iterations: 1) 81,649 msec per iteration (total: 81649, iterations: 1) Avg: 81050 Time spent: ~0.97%
Benjamin Poulain
Comment 4 2009-12-18 03:12:42 PST
Olivier has made a patch to remove QMap from QThread's TLS: 79,986 msec per iteration (total: 79986, iterations: 1) 79,925 msec per iteration (total: 70925, iterations: 1) 78,805 msec per iteration (total: 77805, iterations: 1) This is even better, I close this bug report.
Note You need to log in before you can comment on or make changes to this bug.