Skip to content

Small marshal fixes#9156

Merged
headius merged 4 commits into
jruby:10.1-devfrom
headius:marshal_fixes
Jan 7, 2026
Merged

Small marshal fixes#9156
headius merged 4 commits into
jruby:10.1-devfrom
headius:marshal_fixes

Conversation

@headius

@headius headius commented Jan 6, 2026

Copy link
Copy Markdown
Member

Small fixes for Marshal logic encountered while investigating #9152.

  • Avoid double lookup of link values during dump (performance).
  • Use smaller link map.
  • Skip linkability check for callers that are automatically linkable.
  • Avoid constructing Bignum object to marshal large fixnums.

@headius
headius force-pushed the marshal_fixes branch 2 times, most recently from d3912e0 to 134c0d8 Compare January 6, 2026 09:10
@headius
headius changed the base branch from master to 10.1-dev January 7, 2026 18:06
@headius headius added this to the JRuby 10.1.0.0 milestone Jan 7, 2026
The previous logic checked if the link was present, and if so it
proceeded to look it up again to get the link value. This saves a
hash lookup per linked object in the dump stream.
All callers of this method are already linkable objects (i.e. not
nil, boolean, or in CRuby fixnum range) so there's no need for the
repeated checks in registerLinkTarget. The new registerObject
retains those checks as an assert but otherwise assumes caller is
doing the right thing.
@headius
headius marked this pull request as ready for review January 7, 2026 19:29
@headius
headius merged commit 0b2fc30 into jruby:10.1-dev Jan 7, 2026
75 of 76 checks passed
@headius
headius deleted the marshal_fixes branch January 7, 2026 19:48
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