Bug 240186 - WIP: Hint to compiler about likely result of various feature flags
Summary: WIP: Hint to compiler about likely result of various feature flags
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brent Fulgham
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-06 14:44 PDT by Brent Fulgham
Modified: 2022-05-13 14:45 PDT (History)
33 users (show)

See Also:


Attachments
Patch (83.02 KB, patch)
2022-05-06 14:48 PDT, Brent Fulgham
bfulgham: review?
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brent Fulgham 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.
Comment 1 Brent Fulgham 2022-05-06 14:48:59 PDT
Created attachment 458975 [details]
Patch
Comment 2 Brent Fulgham 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.
Comment 3 Simon Fraser (smfr) 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 ?
Comment 4 Brent Fulgham 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.
Comment 5 Sam Sneddon [:gsnedders] 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.
Comment 6 Radar WebKit Bug Importer 2022-05-13 14:45:13 PDT
<rdar://problem/93268359>