Skip to content

⚡ Bolt: Optimize decompression for offset 6 (+423% throughput)#239

Merged
404Setup merged 1 commit intomainfrom
bolt/optimize-decompress-offset6-6778083682881966153
Feb 19, 2026
Merged

⚡ Bolt: Optimize decompression for offset 6 (+423% throughput)#239
404Setup merged 1 commit intomainfrom
bolt/optimize-decompress-offset6-6778083682881966153

Conversation

@404Setup
Copy link
Copy Markdown
Owner

Implemented AVX2/SIMD optimization for LZ77 decompression with offset 6.

  • Added OFFSET6_MASKS table.
  • Added else if offset == 6 block in src/decompress/x86.rs.
  • Added bench_decompress_offset6_micro benchmark in benches/bench_main.rs.
  • Verified 423% throughput improvement.

PR created automatically by Jules for task 6778083682881966153 started by @404Setup

This commit implements a specialized SIMD optimization for `offset == 6` in `decompress_bmi2`.
By using `_mm_shuffle_epi8` with precomputed cyclic masks (`OFFSET6_MASKS`), we can replicate the 6-byte repeating pattern into 16-byte vectors and process data in 48-byte chunks (LCM of 6 and 16).

This avoids the slow scalar fallback loop for offsets < 8.

Benchmark results (bench_decompress_offset6_micro):
- Baseline: ~2.06 GiB/s
- Optimized: ~10.75 GiB/s
- Improvement: +423%

Also added `bench_decompress_offset6_micro` to `benches/bench_main.rs` to verify and track this optimization.

Co-authored-by: 404Setup <[email protected]>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@404Setup 404Setup merged commit 87cf429 into main Feb 19, 2026
1 check passed
@404Setup 404Setup deleted the bolt/optimize-decompress-offset6-6778083682881966153 branch February 19, 2026 02:18
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