Repository navigation
Use ISO-8859-1 for glue bytecode packing - #124
Merged
Merged
Conversation
mcculls
approved these changes
Sep 26, 2026
mcculls
left a comment
Collaborator
There was a problem hiding this comment.
Good suggestion, for the glue we're generating this does indeed make more sense
ygree
force-pushed
the
ygree/simplify-glue-encoding
branch
from
September 28, 2026 16:16
c07f1ab to
b39c68f
Compare
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.
What Does This Do
This removes the padding requirement, avoids the pseudo-UTF-16BE/custom-decoding concern, and slightly reduces the compiled runtime footprint, even though the generated Java source gets larger.
Motivation
ISO-8859-1 gives a direct byte-to-char mapping, so glue decoding becomes a simple packed.getBytes(ISO_8859_1) with no even-length padding requirement and no surrogate edge cases.
Additional Notes
The source gets larger:
Raw generated DefineClassGlue.java is larger: 12,278 B -> 17,268 B.
Everything that is compiled or packaged got smaller:
ClassInjector$MethodPatch.class: 8,031 B -> 7,749 B
class-inject runtime jar: 8,836 B -> 7,894 B
utils jar: 31,030 B -> 30,914 B
even compressed class-inject sources jar got smaller: 7,007 B -> 6,248 B, because octal escapes compress well.
One caveat: on Java 8, the in-memory String object for the packed glue may be larger with Latin-1 because Java 8 stores strings as char[], so twice as many chars means roughly twice the string backing storage. On Java 9+ compact strings likely make it similar or smaller. But this is a tiny, transient-ish class-injection path, while the shipped class/jar footprint is smaller.
Contributor Checklist
Jira ticket: [PROJ-IDENT]