Skip to content

Improve pgo builds#21554

Closed
Ddystopia wants to merge 1 commit intorust-lang:masterfrom
Ddystopia:local-pgo
Closed

Improve pgo builds#21554
Ddystopia wants to merge 1 commit intorust-lang:masterfrom
Ddystopia:local-pgo

Conversation

@Ddystopia
Copy link
Copy Markdown
Contributor

  • feat: allow local absolute paths
  • feat: allow measuring against multiple crates

I'm not as familiar with PGO, do I understand correctly that by running more commands, more measurements do accumulate and then get merged?

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 30, 2026
@Ddystopia
Copy link
Copy Markdown
Contributor Author

One possible improvement would be to report error in case the string passed to --pgo is an absolute path but doesn't exists.

* feat: allow local absolute paths
* feat: allow measuring against multiple crates
@ChayimFriedman2
Copy link
Copy Markdown
Contributor

Do you actually need this, or just thought this is nice to have?

@Ddystopia
Copy link
Copy Markdown
Contributor Author

Well I used it to compile RA to better suit my projects. Does this count as "I actually need this"?

@ChayimFriedman2
Copy link
Copy Markdown
Contributor

Was there a measurable benefit?

@Ddystopia
Copy link
Copy Markdown
Contributor Author

I didn't benchmark it, I'll try to do this in a span of two weeks

@ChayimFriedman2
Copy link
Copy Markdown
Contributor

The reason I ask is that I suspect there won't be any perf benefit from customizing to a project (all rust projects look the same, when looking at the level of branch and cache predictions), therefore I don't want to accept this just because.

@Ddystopia
Copy link
Copy Markdown
Contributor Author

Yeah, I get the point, but my objective is that my projects are quite different as it is either wasm front-ends or embedded software with lots of automatically generated FFI bindings and ra often just dies. I would try to benchmark it against stock ra if there would be some significant benefit.

@lnicola
Copy link
Copy Markdown
Member

lnicola commented Feb 3, 2026

See #19585 (comment), or better, run your own numbers.

@ChayimFriedman2
Copy link
Copy Markdown
Contributor

@Ddystopia Did you check that?

@Ddystopia
Copy link
Copy Markdown
Contributor Author

@ChayimFriedman2

Hi, I did not, I am quite busy lately 😅 . I'll probably get around to this during this weekend. Note my previous comment from a week ago:

I didn't benchmark it, I'll try to do this in a span of two weeks

@Ddystopia
Copy link
Copy Markdown
Contributor Author

I ran tests, there seem to be small gains, not too huge though. It also has some uncaught type error. I'll be using it locally, together with target-cpu=native (I didn't look into how to enable it during compilation with xtastk and will do it later, local-only). Those are some seconds so I'll take them, if you think it's not worth it I'm fine if you close the PR.

simple-fw.txt
complex-fw.txt
simple-backend.txt
complex-backend.txt

@lnicola
Copy link
Copy Markdown
Member

lnicola commented Feb 16, 2026

Is simple our release binary (PGOed on clap) and complex PGOed on specific project, plus target-cpu=native? I see a difference on fw, but not on backend.

@Ddystopia
Copy link
Copy Markdown
Contributor Author

Both are without target-cpu=native, simple is master with pgo on rust-analyzer (I thought you used it). And yeah I also only see the difference on fw.

@Ddystopia Ddystopia closed this Feb 24, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants