Skip to content

perf: faster WarmAddresses short precompile bits lookup#3745

Open
borngraced wants to merge 1 commit into
bluealloy:mainfrom
borngraced:faster-warm-addresses-short-precompile-bits-lookup
Open

perf: faster WarmAddresses short precompile bits lookup#3745
borngraced wants to merge 1 commit into
bluealloy:mainfrom
borngraced:faster-warm-addresses-short-precompile-bits-lookup

Conversation

@borngraced

Copy link
Copy Markdown
Contributor

is_warm/is_cold (via the short precompile │ bitset) is on a very hot path. This optimization removes the bitvec + Arc overhead by using a fixed size array [u8; 38] with direct bit manipulation, matching the technique from #2618.

This is a rough estimate microbenchmark numbers from my machine.. can be faster on yours.

Benchmark

Implementation Time per op Ops/sec Speedup
Fixed Array + Manual Bits 9.15 ns 109.3M 10.1x faster
BitVec (legacy) 92.62 ns 10.8M baseline
Pattern Fixed Array BitVec Speedup
Sequential 8.84 ns 92.24 ns 10.4x
Random 8.43 ns 90.83 ns 10.8x

Also got rid of the bitvec dep from context crate

@borngraced
borngraced force-pushed the faster-warm-addresses-short-precompile-bits-lookup branch from 95a6598 to 1e6a772 Compare June 7, 2026 03:08
@codspeed-hq

codspeed-hq Bot commented Jun 7, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 4.02%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 180 untouched benchmarks
⏩ 1 skipped benchmark1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation EXTCODECOPY_50 51.7 µs 49.7 µs +4.02%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing borngraced:faster-warm-addresses-short-precompile-bits-lookup (f9e7ff3) with main (cfcf038)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports.

@borngraced
borngraced force-pushed the faster-warm-addresses-short-precompile-bits-lookup branch from 1e6a772 to b567322 Compare June 7, 2026 03:10
@borngraced
borngraced marked this pull request as draft June 7, 2026 04:09
nits

use direct path to std format

fix clippy

run zepter

fix backward compatibility
@borngraced
borngraced force-pushed the faster-warm-addresses-short-precompile-bits-lookup branch from a36606f to f9e7ff3 Compare June 7, 2026 04:45
@borngraced
borngraced marked this pull request as ready for review June 7, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant