Skip to content

feat: DeltaScheme adjustable compression ratio threshold - #8461

Merged
joseph-isaacs merged 3 commits into
developfrom
claude/delta-threshold-configurable-77gyu7
Jun 17, 2026
Merged

feat: DeltaScheme adjustable compression ratio threshold#8461
joseph-isaacs merged 3 commits into
developfrom
claude/delta-threshold-configurable-77gyu7

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Delta is a more expensive compression scheme to decompress, so using it for a small win in compression since is a bad idea.

Set the default to 1.25

Summary

This PR makes the DeltaScheme configurable by allowing users to specify a custom minimum penalized compression ratio threshold, rather than using a hardcoded value. This enables more flexible tuning of when Delta encoding is selected during compression.

claude added 2 commits June 17, 2026 10:40
Extract the hard-coded minimum compression ratio gate for the Delta
integer scheme into a named MIN_DELTA_RATIO constant and raise the
default from 1.0 to 1.25, matching the existing DELTA_PENALTY and
MIN_DELTA_LEN tunables.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Move the minimum penalized compression ratio from a module constant onto
DeltaScheme as a field, configurable via DeltaScheme::new(min_ratio).
DeltaScheme::default() / DeltaScheme::DEFAULT use DEFAULT_MIN_RATIO (1.25).
The static scheme registry uses the const DEFAULT so it stays usable in
const context.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs
joseph-isaacs requested a review from a team June 17, 2026 11:10
@joseph-isaacs joseph-isaacs changed the title Make DeltaScheme configurable with adjustable compression ratio threshold feat: DeltaScheme adjustable compression ratio threshold Jun 17, 2026
@joseph-isaacs joseph-isaacs added the changelog/feature A new feature label Jun 17, 2026
@joseph-isaacs
joseph-isaacs requested a review from AdamGS June 17, 2026 11:12
… impl

Remove the DEFAULT_MIN_RATIO and DEFAULT associated consts; DeltaScheme's
default ratio (1.25) now lives only in the Default impl. The static scheme
registry constructs DeltaScheme::new(1.25) directly in const context.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@codspeed-hq

codspeed-hq Bot commented Jun 17, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 3 improved benchmarks
❌ 3 regressed benchmarks
✅ 1539 untouched benchmarks
⏩ 10 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation bitwise_not_vortex_buffer_mut[128] 186.1 ns 244.4 ns -23.86%
Simulation bitwise_not_vortex_buffer_mut[1024] 246.4 ns 304.7 ns -19.14%
Simulation bitwise_not_vortex_buffer_mut[2048] 369.4 ns 427.8 ns -13.64%
Simulation take_map[(0.1, 0.5)] 1,180.4 µs 992.5 µs +18.93%
Simulation take_map[(0.1, 1.0)] 1.9 ms 1.7 ms +15.02%
Simulation encode_varbin[(1000, 2)] 177.4 µs 158.4 µs +12%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing claude/delta-threshold-configurable-77gyu7 (543a598) with develop (4b867a0)

Open in CodSpeed

Footnotes

  1. 10 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.

@joseph-isaacs
joseph-isaacs enabled auto-merge (squash) June 17, 2026 11:33
@joseph-isaacs
joseph-isaacs merged commit a45bb60 into develop Jun 17, 2026
62 of 63 checks passed
@joseph-isaacs
joseph-isaacs deleted the claude/delta-threshold-configurable-77gyu7 branch June 17, 2026 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants