Skip to content

perf: teach borrow inference about arrays#13064

Merged
hargoniX merged 2 commits intomasterfrom
hbv/array_get_infer_borrow
Mar 23, 2026
Merged

perf: teach borrow inference about arrays#13064
hargoniX merged 2 commits intomasterfrom
hbv/array_get_infer_borrow

Conversation

@hargoniX
Copy link
Copy Markdown
Contributor

@hargoniX hargoniX commented Mar 23, 2026

This PR informs the borrow inference that if an Array is borrowed and we index into it, the value we obtain is effectively a borrowed value as well. This helps improve the ABI of operations that recurse on linked structures containing arrays such as tries or persistent hash maps.

@hargoniX hargoniX requested a review from leodemoura as a code owner March 23, 2026 16:25
@hargoniX
Copy link
Copy Markdown
Contributor Author

!bench

@leanprover-radar
Copy link
Copy Markdown

leanprover-radar commented Mar 23, 2026

Benchmark results for aa4e459 against fb1eb9a are in. Significant changes detected! @hargoniX

  • build//instructions: -32.0G (-0.26%)

Large changes (3✅)

  • compiled/parser//instructions: -323.2M (-0.85%)
  • compiled/phashmap//instructions: -259.3M (-2.65%)
  • elab/big_do//instructions: -196.1M (-0.82%)

Medium changes (1✅)

  • elab/cbv_arm_ldst//instructions: -1.2G (-1.54%)

Small changes (189✅, 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 Mar 23, 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 fb1eb9aaa760368d64c80a38ebca4825abed916d --onto 4bf7fa7447eea00cecba8327bb9c9e5f4485f0a7. You can force Mathlib CI using the force-mathlib-ci label. (2026-03-23 17:16:54)

@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 fb1eb9aaa760368d64c80a38ebca4825abed916d --onto cfa8c5a036d6990635c6ec50b02d0e806995cec3. You can force reference manual CI using the force-manual-ci label. (2026-03-23 17:16:56)

@hargoniX hargoniX added the changelog-compiler Compiler, runtime, and FFI label Mar 23, 2026
@hargoniX hargoniX enabled auto-merge March 23, 2026 17:59
@hargoniX hargoniX added this pull request to the merge queue Mar 23, 2026
Merged via the queue into master with commit 86175be Mar 23, 2026
16 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