Skip to content

docs: Update performance.md #188

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

Merged
merged 2 commits into from
May 28, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions book/src/performance.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ opt-level = 3

This may affect clean compile times in debug mode, but incremental compiles
will be faster.

## Profile-Guided Optimization (PGO)

To optimize Rinja's performance, you can compile your application with [Profile-Guided Optimization](https://doc.rust-lang.org/rustc/profile-guided-optimization.html). According to the [tests](https://github.com/mitsuhiko/minijinja/pull/588#issuecomment-2387957123), PGO can improve the library performance by 15%.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We write rinja in lowercase so please update. :)

Could you also explain in the book directly instead of linking to a github issue? The explanations there are great so I think you can mostly copy-paste it as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We write rinja in lowercase so please update. :)

Sorry - I just copied it from line 30th "... Rinja's derive macros" ;)

Could you also explain in the book directly instead of linking to a github issue? The explanations there are great so I think you can mostly copy-paste it as is.

Sure. Which details should be copied from the GitHub issue to the book? Just asking because I am sure that you don't need all the details (like my test env). Better clarify upfront then rework multiple times.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anything needed to be able to use PGO. What you need to install etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instructions about how to use PGO for Rust programs are described in the official Rustc docs that I already linked to the docs: https://doc.rust-lang.org/rustc/profile-guided-optimization.html - it's an official instruction about how to implement PGO for Rust programs (including a note about about cargo-pgo). My GitHub issue describes how to reproduce my benchmark results. I guessed that target users are not interested in reproducing my benchmarks but interested in optimizing their rinja-based apps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So maybe just remove the GitHub link at all from the docs? :)