Skip to content
This repository has been archived by the owner on Jul 1, 2023. It is now read-only.

Promote BOLT to the chromium team #302

Closed
LifeIsStrange opened this issue Jul 29, 2022 · 11 comments
Closed

Promote BOLT to the chromium team #302

LifeIsStrange opened this issue Jul 29, 2022 · 11 comments

Comments

@LifeIsStrange
Copy link

I'm pretty sure them not using it is a huge missed opportunity for end users performance (billions of humans) (and related projects such as Skia, ANGLE, freetype, etc)

That would be quite a meaningful utilitaristic goal.

@insilications
Copy link

Indeed, at such large scales the gains are huge.

@aaupov
Copy link
Contributor

aaupov commented Aug 4, 2022

I'm pretty sure them not using it is a huge missed opportunity for end users performance (billions of humans) (and related projects such as Skia, ANGLE, freetype, etc)

That would be quite a meaningful utilitaristic goal.

I don't recall seeing an interest from chromium devs. Do you have any contacts? Feel free to ping them here.

@corona10
Copy link

corona10 commented Aug 18, 2022

@aaupov

FYI, CPython now adopt llvm-bolt as an experimental feature: python/cpython@214eb2c

I am expecting the usage through ./configure --enable-optimizations --with-lto --enable-bolt

@LifeIsStrange
Copy link
Author

Friendly ping @nfischer
Since chromium use LTO and PGO, leveraging BOLT would be the next logical step for improving end users performance of the web

@nfischer
Copy link

nfischer commented Sep 7, 2022

It looks like folks on the Chromium build team are already thinking about this! 😄 I suggest you click the "star" icon for https://crbug.com/1163978 if you would like to be notified of further updates.

@aaupov
Copy link
Contributor

aaupov commented Jan 5, 2023

Quick update: I tried to apply BOLT to Chromium but currently blocked by llvm/llvm-project#59794

@aaupov
Copy link
Contributor

aaupov commented Jan 8, 2023

Update:

  • stripping __typeid_ symbols with strip/llvm-strip is not possible due to dangling relocations:
not stripping symbol '__typeid__ZTSFvPKN4base8internal13BindStateBaseEE_global_addr' because it is named in a relocation
  • skipping __typeid_ symbols in BOLT is a feasible workaround which unblocks processing of the binary (https://reviews.llvm.org/D141229)
  • strict mode needs to be disabled in perf aggregation (perf2bolt) due to unclaimed PC-relative relocations
  • Builtins_.* functions need to be skipped due to V8 (see Optimizing NodeJS with BOLT)
  • the binary can be successfully processed by BOLT (no crash)
  • however, the optimized binary crashes at startup due to SIGILL in malloc.cfi – looks like we're violating Clang's CFI invariants (https://clang.llvm.org/docs/ControlFlowIntegrity.html)

@aaupov
Copy link
Contributor

aaupov commented Jan 8, 2023

On the first glance CFI enabled by Chromium on Linux/x86 in official build mode is non-trivial to support in BOLT. I'll try to run BOLT on just Release+PGO build to decide if further effort is worthwhile.

@aaupov
Copy link
Contributor

aaupov commented Jan 13, 2023

I've made a post summarizing my findings: https://aaupov.github.io/blog/2022/11/12/bolt-chromium

In short, BOLT appears to be reasonably effective for Chromium, with Speedometer results comparable to that of PGO build (https://blog.chromium.org/2020/08/chrome-just-got-faster-with-profile.html): 7.7% speedup from PGO (Mac), ~6% speedup from BOLT (Linux) on top of PGO.

To note, BOLT profile definitely wasn't of the highest quality, so the performance can potentially be further improved.

@LifeIsStrange
Copy link
Author

@aaupov this is huge!! I hope it will end up being enabled by default for public releases :)

@aaupov
Copy link
Contributor

aaupov commented Jan 16, 2023

https://bugs.chromium.org/p/chromium/issues/detail?id=1163978#c15

@aaupov aaupov closed this as completed Jan 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants