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

perf: avoid expr copies in replace_rec_fn::apply #4702

Merged
merged 3 commits into from
Aug 2, 2024

Conversation

legrosbuffle
Copy link
Contributor

Those represent ~13% of the time spent in save_result,
even though r is a temporary in all cases but one.

See #4698 for details.

…rators

Right now those constructors result in a copy instead of the desired
move. We've measured that expr copying and assignment by itself uses
around 10% of total runtime on our workloads.

See leanprover#4698 for details.
Those represent ~13% of the time spent in `save_result`,
even though `r` is a temporary in all cases but one.

See leanprover#4698 for details.
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jul 9, 2024
@Kha
Copy link
Member

Kha commented Aug 2, 2024

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit 59e4228.
There were significant changes against commit 582d6e7:

  Benchmark     Metric         Change
  ==============================================
+ reduceMatch   instructions    -2.3% (-608.5 σ)
+ stdlib        instructions    -1.3% (-497.1 σ)

@leanprover-bot leanprover-bot added the P-high We will work on this issue label Aug 2, 2024
@leodemoura leodemoura marked this pull request as ready for review August 2, 2024 18:07
@leodemoura leodemoura self-requested a review as a code owner August 2, 2024 18:07
@leanprover-community-mathlib4-bot
Copy link
Collaborator

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase b07384acbb67ca43e58d4f5d78ec8ea81a5ad36e --onto ee430b6c80f7fbd80c3cae1804e634cb4318d147. (2024-08-02 18:23:02)

@leodemoura leodemoura added this pull request to the merge queue Aug 2, 2024
Merged via the queue into leanprover:master with commit 9c4028a Aug 2, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P-high We will work on this issue toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants