refactor: reduce tracked query monomorphization - #1150
Conversation
✅ Deploy Preview for salsa-rs canceled.
|
Merging this PR will regress 2 benchmarks
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing Footnotes
|
e1ed6be to
9e486e7
Compare
9e486e7 to
e1ed6be
Compare
e1ed6be to
4201f31
Compare
9e2b7c6 to
9d4e55b
Compare
372a630 to
cb798e2
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
cb798e2 to
bff0710
Compare
This comment was marked as duplicate.
This comment was marked as duplicate.
1 similar comment
This comment was marked as duplicate.
This comment was marked as duplicate.
|
@codspeedbot what's the reason that the walltime benchamrks regress? |
Here's what I found for the latest report (head 1. Why the Simulation benchmarks improve by that muchThe improvements are exactly the pure cached-hit loops (
The flamegraphs show where those instructions went. On One thing worth keeping in mind when reading the 9.5%: that benchmark is ~49% modeled memory time (chasing the memo pointer) and ~53% instructions in the base. Simulation adds those components, so a −16% instruction cut becomes −8.7% of the total. On real hardware those loads overlap with execution, so the same saving should be expected to show up much smaller in wall time — and indeed the hit-dominated WallTime benchmarks ( Also visible on the Simulation side: the recoverable-cycle path pays for the erasure. 2. Why the WallTime benchmarks regressAll 10 WallTime benchmarks moved in the same direction, and the size of the move tracks how much of the workload is not a cached hit:
That pattern points at the execute/validate path, so I checked whether it actually does more work. It does not:
So on identical inputs the head executes the same instructions, touches the same memory, and allocates the same bytes. What did change is the code layout on exactly the paths those benchmarks stress. I want to be explicit about what is not established: I could not reproduce the regression outside the runner, so the layout explanation stays a hypothesis. Two caveats also argue for confirming the signal first: these divan benchmarks use Suggested next steps, in order:
Summary
Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot. |
|
Hi @MichaReiser, I’m Samuel from CodSpeed. I work on the CodSpeed AI agent 👋 Sorry about the failed requests. I fixed the bug that prevented the agent from replying here and restarted the latest request. Feel free to tag me, @SuperMuel, if you run into any other issues with it! |
bff0710 to
34bf6e2
Compare
This reduces tracked-query monomorphization, keeps fetch, shallow validation, and panic execution typed, and shares recoverable-cycle execution. Interner erasure is intentionally split into #1204.
Measured against #1206 (
c89537c4) on pinnedty_python_semantic, total LLVM IR falls 109,056 lines (3.59%), Salsa function-framework IR falls 82,310 lines (25.63%), and a stripped maturin-builttyshrinks 303,200 bytes (1.16%). The matched release DateType simulation instruction count regresses 0.47%; full and incremental compile-time differences remain within run-to-run noise.Testing:
cargo fmt --check;cargo check --workspace --all-features;cargo test --workspace --quiet; matched pinned ty/DateType LLVM, instruction, compile-time, and binary-size measurements. Strict workspace Clippy reports only #1206's existingresult_large_errwarning.