Skip to content

Use an unsafe trait to reinterpret packed struct references as bytes#7336

Merged
AdamGS merged 1 commit intodevelopfrom
adamg/unsafe-packed-bytes-trait
Apr 16, 2026
Merged

Use an unsafe trait to reinterpret packed struct references as bytes#7336
AdamGS merged 1 commit intodevelopfrom
adamg/unsafe-packed-bytes-trait

Conversation

@AdamGS
Copy link
Copy Markdown
Contributor

@AdamGS AdamGS commented Apr 8, 2026

Summary

This is a cosmetic change to make it clearer what is happening when re-interpreting references as raw bytes to serialize plans, making it harder to mis-use by making it a more specific trait.

@AdamGS AdamGS requested a review from 0ax1 April 8, 2026 11:37
@AdamGS AdamGS added the changelog/chore A trivial change label Apr 8, 2026
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 8, 2026

Merging this PR will improve performance by 20.23%

⚡ 9 improved benchmarks
✅ 1154 untouched benchmarks
⏩ 1457 skipped benchmarks1

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation take_map[(0.1, 0.5)] 1,154.5 µs 985.6 µs +17.14%
Simulation take_map[(0.1, 1.0)] 2 ms 1.6 ms +20.23%
Simulation patched_take_10k_contiguous_patches 258.1 µs 227.7 µs +13.32%
Simulation patched_take_10k_first_chunk_only 302 µs 271.7 µs +11.15%
Simulation patched_take_10k_random 270.3 µs 240 µs +12.65%
Simulation patched_take_10k_contiguous_not_patches 258.4 µs 228.1 µs +13.29%
Simulation patched_take_10k_dispersed 316 µs 285.8 µs +10.58%
Simulation take_10k_dispersed 284.4 µs 239.5 µs +18.76%
Simulation take_10k_first_chunk_only 270.6 µs 225.7 µs +19.91%

Comparing adamg/unsafe-packed-bytes-trait (7129565) with develop (12f63a4)

Open in CodSpeed

Footnotes

  1. 1457 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Signed-off-by: Adam Gutglick <adam@spiraldb.com>
@AdamGS AdamGS force-pushed the adamg/unsafe-packed-bytes-trait branch from 178a612 to 7129565 Compare April 16, 2026 16:07
@AdamGS AdamGS enabled auto-merge (squash) April 16, 2026 16:07
@AdamGS AdamGS merged commit 61dffa9 into develop Apr 16, 2026
58 checks passed
@AdamGS AdamGS deleted the adamg/unsafe-packed-bytes-trait branch April 16, 2026 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/chore A trivial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants