Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PGO in -prod #7024

Open
medvednikov opened this issue Nov 29, 2020 · 4 comments
Open

Use PGO in -prod #7024

medvednikov opened this issue Nov 29, 2020 · 4 comments
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@medvednikov
Copy link
Member

medvednikov commented Nov 29, 2020

10% faster:

Benchmark #1: ./v -o v.c cmd/v
  Time (mean ± σ):     207.1 ms ±   2.9 ms    [User: 162.3 ms, System: 43.9 ms]
  Range (min … max):   203.0 ms … 217.3 ms    100 runs


Benchmark #1: ./v2 -o v.c cmd/v
  Time (mean ± σ):     222.8 ms ±   3.4 ms    [User: 175.9 ms, System: 44.9 ms]
  Range (min … max):   217.9 ms … 232.6 ms    100 runs
./v -cc clang -o v cmd/v -cflags "-O3 -flto -fprofile-generate=profile" && ./v -o v.c cmd/v && llvm-profdata merge -output=code.profdata profile/ && ./v -cc clang -o v cmd/v -cflags "-O3 -flto -fprofile-use=code.profdata"

Thanks @ka-weihe

@medvednikov
Copy link
Member Author

I don't think PGO can be used in -prod, because you have to compile the program with -fprofile-generate= first, and then run the program to generate data before building the final binary with -fprofile-use=.

So will need another flag and/or enable this in v self -prod

@dumblob
Copy link
Contributor

dumblob commented Nov 30, 2020

Speaking of -prod optimizations - how about #3424 if there is no @live function in the source (which is actually the vast majority of scenarios)?

@medvednikov
Copy link
Member Author

Sounds good @dumblob

@medvednikov medvednikov added the Bug This tag is applied to issues which reports bugs. label Jul 19, 2022
@zamazan4ik
Copy link

Any updates on integrating PGO into the compiler and/or V build scripts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

3 participants