Skip to content

perf: dec specialization#13788

Merged
hargoniX merged 5 commits into
masterfrom
hbv/drop_spec
May 19, 2026
Merged

perf: dec specialization#13788
hargoniX merged 5 commits into
masterfrom
hbv/drop_spec

Conversation

@hargoniX
Copy link
Copy Markdown
Contributor

@hargoniX hargoniX commented May 19, 2026

This PR generates specialized code for invoking dec on values whose shape is known. This puts branch prediction pressure off lean_dec_ref_cold as the shape of the constructor should now be compiled into the executable.

@hargoniX
Copy link
Copy Markdown
Contributor Author

!bench

@leanprover-radar
Copy link
Copy Markdown

leanprover-radar commented May 19, 2026

Benchmark results for b5ce70c against e09155b are in. There are significant results. @hargoniX

  • build//instructions: -219.4G (-1.91%)

Large changes (14✅, 3🟥)

  • compiled/deriv//instructions: -182.9M (-2.63%)
  • compiled/hashmap//instructions: -40.3M (-1.19%)
  • compiled/ilean_roundtrip//instructions: -373.2M (-1.58%)
  • compiled/liasolver//instructions: -106.7M (-2.60%)
  • compiled/parser//instructions: -145.9M (-0.42%)
  • compiled/phashmap//instructions: -71.0M (-0.80%)
  • compiled/rbmap//instructions: -173.4M (-2.05%)
  • compiled/rbmap_checkpoint2//instructions: -109.8M (-1.22%)
  • compiled/rbmap_fbip//instructions: -62.2M (-0.86%)
  • compiled/rbmap_library//instructions: -73.4M (-0.77%)
  • compiled/unionfind//instructions: -376.4M (-1.39%)
  • compiled/watchdogRss//instructions: -425.4M (-1.66%)
  • compiled/workspaceSymbolsNewRanges//instructions: -16.7M (-2.33%)
  • elab/big_do//instructions: -503.5M (-2.28%)
  • 🟥 size/compile/.out//bytes: +87MiB (+4.35%)
  • 🟥 size/install//bytes: +19MiB (+0.64%)
  • 🟥 size/libleanshared.so//bytes: +7MiB (+4.80%)

Medium changes (58✅, 1🟥)

Too many entries to display here. View the full report on radar instead.

Small changes (2028✅, 2🟥)

Too many entries to display here. View the full report on radar instead.

@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 May 19, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase e09155b6f91642c2e50c3eb476823947200a90d0 --onto 43ef70db63e2c1c1720b84fd153125c96a00c5d2. You can force Mathlib CI using the force-mathlib-ci label. (2026-05-19 13:31:59)

@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI will not be attempted unless your PR branches off the nightly-with-manual branch. Try git rebase e09155b6f91642c2e50c3eb476823947200a90d0 --onto 803553a556fd82fa1060efb0c43eda542130cb16. You can force reference manual CI using the force-manual-ci label. (2026-05-19 13:32:01)

@hargoniX hargoniX changed the title perf: drop specialization perf: dec specialization May 19, 2026
@hargoniX hargoniX added the changelog-compiler Compiler, runtime, and FFI label May 19, 2026
@hargoniX
Copy link
Copy Markdown
Contributor Author

!bench

@hargoniX
Copy link
Copy Markdown
Contributor Author

!bench

@hargoniX hargoniX marked this pull request as ready for review May 19, 2026 15:04
@hargoniX hargoniX requested a review from leodemoura as a code owner May 19, 2026 15:04
@leanprover-radar
Copy link
Copy Markdown

leanprover-radar commented May 19, 2026

Benchmark results for d13536b against e09155b are in. (These commits have already been benchmarked in a previous command.) There are significant results. @hargoniX

  • build//instructions: -197.6G (-1.72%)

Large changes (13✅, 3🟥)

  • compiled/deriv//instructions: -182.7M (-2.62%)
  • compiled/hashmap//instructions: -40.6M (-1.20%)
  • compiled/ilean_roundtrip//instructions: -378.1M (-1.61%)
  • compiled/liasolver//instructions: -106.8M (-2.60%)
  • compiled/parser//instructions: -143.3M (-0.41%)
  • compiled/phashmap//instructions: -70.9M (-0.80%)
  • compiled/rbmap//instructions: -177.3M (-2.09%)
  • compiled/rbmap_checkpoint2//instructions: -78.0M (-0.87%)
  • compiled/rbmap_fbip//instructions: -62.5M (-0.87%)
  • 🟥 compiled/rbmap_library//instructions: +61.6M (+0.65%)
  • compiled/unionfind//instructions: -376.6M (-1.39%)
  • compiled/watchdogRss//instructions: -424.2M (-1.66%)
  • compiled/workspaceSymbolsNewRanges//instructions: -17.0M (-2.37%)
  • elab/big_do//instructions: -453.0M (-2.06%)
  • 🟥 size/compile/.out//bytes: +63MiB (+3.14%)
  • 🟥 size/libleanshared.so//bytes: +5MiB (+3.56%)

Medium changes (53✅, 1🟥)

Too many entries to display here. View the full report on radar instead.

Small changes (1988✅)

Too many entries to display here. View the full report on radar instead.

1 similar comment
@leanprover-radar
Copy link
Copy Markdown

leanprover-radar commented May 19, 2026

Benchmark results for d13536b against e09155b are in. (These commits have already been benchmarked in a previous command.) There are significant results. @hargoniX

  • build//instructions: -197.6G (-1.72%)

Large changes (13✅, 3🟥)

  • compiled/deriv//instructions: -182.7M (-2.62%)
  • compiled/hashmap//instructions: -40.6M (-1.20%)
  • compiled/ilean_roundtrip//instructions: -378.1M (-1.61%)
  • compiled/liasolver//instructions: -106.8M (-2.60%)
  • compiled/parser//instructions: -143.3M (-0.41%)
  • compiled/phashmap//instructions: -70.9M (-0.80%)
  • compiled/rbmap//instructions: -177.3M (-2.09%)
  • compiled/rbmap_checkpoint2//instructions: -78.0M (-0.87%)
  • compiled/rbmap_fbip//instructions: -62.5M (-0.87%)
  • 🟥 compiled/rbmap_library//instructions: +61.6M (+0.65%)
  • compiled/unionfind//instructions: -376.6M (-1.39%)
  • compiled/watchdogRss//instructions: -424.2M (-1.66%)
  • compiled/workspaceSymbolsNewRanges//instructions: -17.0M (-2.37%)
  • elab/big_do//instructions: -453.0M (-2.06%)
  • 🟥 size/compile/.out//bytes: +63MiB (+3.14%)
  • 🟥 size/libleanshared.so//bytes: +5MiB (+3.56%)

Medium changes (53✅, 1🟥)

Too many entries to display here. View the full report on radar instead.

Small changes (1988✅)

Too many entries to display here. View the full report on radar instead.

@hargoniX hargoniX added the release-ci Enable all CI checks for a PR, like is done for releases label May 19, 2026
@hargoniX hargoniX removed the release-ci Enable all CI checks for a PR, like is done for releases label May 19, 2026
@hargoniX hargoniX enabled auto-merge May 19, 2026 17:27
@hargoniX hargoniX added this pull request to the merge queue May 19, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 19, 2026
@hargoniX hargoniX added this pull request to the merge queue May 19, 2026
Merged via the queue into master with commit 1f23107 May 19, 2026
32 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog-compiler Compiler, runtime, and FFI 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.

3 participants