Cut scratch allocation for short compression inputs - #40
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Short inputs currently allocate a 65,536-entry token array and full history ring. Bound scratch arrays by input length for final calls, while non-final streams retain the full reusable history ring.
A three-fork Linux JVM confirmation measured 6.11x faster compression for the 100-byte fixture, 27.0 to 4.4 microseconds, and 1.30x for the small model. Large fixtures retain their previous allocation sizes; text timings vary across unchanged-baseline forks, so no text-speed claim is made.
Linux tests cover empty/tiny inputs, dictionaries and final/non-final history reuse. All 70 corpus/level outputs passed JDK and KFlate decoding and matched baseline SHA-256 hashes. Full 100% instruction/branch coverage verification passed.
Initial and three-fork confirmation samples, output sizes and saved Kompress comparisons are in
performance/2026-09-09-scratch/RESULTS.md. Independent PR againstdev-1.1.0.