Repository navigation
Conversation
Read built-in primitive arrays into bounded spans to avoid per-element factory calls and boxing. Preserve scalar decoding for custom factories, field readers, binary readers, and unsupported byte order.
Cache a typed reader delegate for each struct type to remove repeated reflection lookup and invocation allocations during STU decoding. Keep reader exceptions wrapped in TargetInvocationException to preserve the existing failure contract.
Reuse assembly type discovery, declared field attributes, and inherited field ordering to reduce repeated reflection during STU manager initialization. Clone publicly exposed attributes and field arrays, and preserve fresh reflection for custom attribute subclasses.
Expand single-line conditionals, clean up whitespace and obsolete comments, and document array decoding, struct reader caching, and metadata ownership to make the optimizations easier to maintain without changing behavior. Validation: Release build passed; all 126 parser regression cases and four metadata comparisons matched the baseline; git diff --check passed.
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.
STU loading repeatedly performs reflection, boxes primitive array elements, and rebuilds inherited field metadata. This change reduces that work through three optimizations:
Performance
Measured results for the implemented optimizations:
The parsing results measure primitive-array and struct-reader improvements together across 186,596 assets, using the median of six measured passes after warmup. Schema initialization was measured separately across three fresh-process runs. Allocation figures represent cumulative allocated bytes, not peak memory usage.