Bug 246932

Summary: Non-reproducible Speedometer 2.1 scores
Product: WebKit Reporter: Vladimir Prelovac <vprelovac>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED INVALID    
Severity: Normal CC: ap
Priority: P2    
Version: WebKit Local Build   
Hardware: Mac (Intel)   
OS: macOS 13   

Description Vladimir Prelovac 2022-10-23 21:59:50 PDT
Hi 

I downloaded the latest Safari TP 156 and it scores 211 on Speedometer 2.1 on my iMac Pro (Intel).


Then I checked oout WebKit branch WebKit-7615.1.8.5 (same as the one used in Safari) 

git clone --depth 1 --branch WebKit-7615.1.8.5 https://github.com/WebKit/WebKit.git

and built it with

Tools/Scripts/build-webkit --release 

When run through run-minibrowser script, it achieves score of 180.

I am wondering what needs to be done to be able to reproduce the same result as the WebKit in Safari TP?

Thanks!
Comment 1 Alexey Proskuryakov 2022-10-24 14:21:17 PDT
You can take a look at Production build configuration to see the differences. I would guess that it's mostly ThinLTO and PGO.

Closing as INVALID, as this does not describe a bug that needs to be fixed in WebKit.
Comment 2 Vladimir Prelovac 2022-10-26 16:12:53 PDT
Thanks @Alexey Proskuryakov for looking into this, I appreciate it.

> You can take a look at Production build configuration to see the differences. 

I looked into the avaialble WebKit documentation and I could not find a reference to the Production build.

I wonder if you could point me in the right direction how to run a Production build?
Comment 3 Alexey Proskuryakov 2022-10-26 17:06:17 PDT
The differences are in DebugRelease.xcconfig files in source code.
Comment 4 Vladimir Prelovac 2022-11-04 19:48:39 PDT
@Alexey Proskuryakov 

After a lot of looking around I was able to find 

Tools/Scripts/build-and-collect-pgo-profiles

which referneces two techniques you describe and uses:

make release WK_LTO_MODE=thin ENABLE_LLVM_PROFILE_GENERATION=ON

It also then proceeds to run various benchamrks and collect PGO data. Looking good!

Question: How do I run the rebuild process to include the PGO data folder?
Comment 5 Vladimir Prelovac 2022-11-09 07:29:19 PST
Thanks Alexey I was able to figure it out eventually. I wonder if the Production build should be better documented to benefit the wider community?
Comment 6 Alexey Proskuryakov 2022-11-09 09:00:24 PST
Such documentation would be welcome indeed.

It is not straightforward for us to do because most differences are related to how Apple internal build system works, and are thus irrelevant to everyone else. Distilling steps necessary to apply performance optimizations is valuable. Great to know that you were able to achieve parity!
Comment 7 Vladimir Prelovac 2022-11-09 09:49:59 PST
A "Production" build produces 20% performance improvement over Release WebKit. So anyone working With WebKit would benefit, especially as the gain is 'free' (just build process optimization). 

What is the best way to structure this documentation contribution? (as in where in repo)
Comment 8 Alexey Proskuryakov 2022-11-09 10:05:53 PST
In the past, I'd say trac.webkit.org, but looks like people are de facto using GitHub wiki these days.