Repository navigation
perf: compress embedded JDK metadata for v0.8.0 - #32
Merged
Merged
Conversation
This was referenced Nov 13, 2026
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.
The JDK invocation catalog was embedding 10.90 MiB of uncompressed JSON into every Javajive consumer. Embed a deterministic zstd asset instead and decode it only when the existing one-time catalog loader needs it. All supported JDK profiles, provenance checks, constructor classfiles, and offline behavior remain available.
The compressed catalog is 912,885 bytes (0.87 MiB), down from 11,428,730 bytes. A controlled Go 1.22.12 darwin/arm64 CLI build with
-ldflags '-s -w'shrinks from 45,324,642 to 34,943,730 bytes: 9.90 MiB / 22.90% smaller, including the zstd decoder.A five-run catalog-decoding benchmark on the same machine has a median of 87.1 ms for plain JSON and 93.4 ms for compressed JSON: about 6.3 ms extra on the first required catalog decode, plus 11.1 MiB of additional temporary allocations. The decoded metadata remains cached by the existing one-time loader; the extra JSON buffer is not retained.
Keep the reviewed JSON as regeneration input, add
go generate ./classparser, and include a byte-for-byte compressed/source equality test in the required corpus gate. Existing metadata tests use the production decoder. The constructor ZIP stays unchanged. The codec dependency matches Yaklang's existingklauspost/compress v1.17.9.Bump the library/CLI version to 0.8.0 for the release following universal-input PR #31.
Validation:
CGO_ENABLED=0 go build ./...go generate ./classparserproduces the identical SHA256.javajive 0.8.0;git diff --checkpasses.The compressed asset saves executable disk space. This does not claim the same reduction for an already compressed distribution package or remove runtime JDK metadata.