Bug 240186

Summary: WIP: Hint to compiler about likely result of various feature flags
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebKit Misc.Assignee: Brent Fulgham <bfulgham>
Status: NEW    
Severity: Normal CC: allan.jensen, calvaris, cdumez, changseok, dino, eric.carlson, esprehn+autocc, ews-watchlist, fred.wang, glenn, gsnedders, gyuyoung.kim, hi, hta, japhet, jer.noble, joepeck, kangil.han, kondapallykalyan, macpherson, menard, mifenton, mkwst, mmaxfield, pangle, pdr, philipj, sergio, simon.fraser, tommyw, webkit-bug-importer, youssefdevelops, y_soliman
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch bfulgham: review?, ews-feeder: commit-queue-

Brent Fulgham
Reported 2022-05-06 14:44:09 PDT
We have a large number of WKPreference switches that exist for rare debugging or experimentation purposes, or for specific test operations. We should hint to the compiler when we know what the likely answer is, so that normal page loading is as efficient as possible.
Attachments
Patch (83.02 KB, patch)
2022-05-06 14:48 PDT, Brent Fulgham
bfulgham: review?
ews-feeder: commit-queue-
Brent Fulgham
Comment 1 2022-05-06 14:48:59 PDT
Brent Fulgham
Comment 2 2022-05-06 14:49:24 PDT
This patch will be used to do some A/B performance testing to see if it is worth doing.
Simon Fraser (smfr)
Comment 3 2022-05-06 14:55:08 PDT
Comment on attachment 458975 [details] Patch If we change the default value of a setting, is there a script we can run that updates all the LIKELY/UNLIKELY ?
Brent Fulgham
Comment 4 2022-05-06 14:57:12 PDT
(In reply to Simon Fraser (smfr) from comment #3) > Comment on attachment 458975 [details] > Patch > > If we change the default value of a setting, is there a script we can run > that updates all the LIKELY/UNLIKELY ? Not today, but we SHOULD. I did a pass where I took all the "default true" features, or the "default false" weird debuggy features, and purposefully did not touch things that were a mix (depending on platform), or were in active development and would presumably become on by default in the future. I'm mostly curious if hinting like this will have any benefit. If it does, it would be more ammunition to remove feature flags whenever possible to improve performance.
Sam Sneddon [:gsnedders]
Comment 5 2022-05-09 09:39:21 PDT
If we had metadata which bug 222885 suggests, could we not autogenerate this in the getters? Both clang and gcc should be able to propagate the hint from the return value, which also avoids the problems with updating everything.
Radar WebKit Bug Importer
Comment 6 2022-05-13 14:45:13 PDT
Note You need to log in before you can comment on or make changes to this bug.