Skip to content

perf(core): avoid primitive fingerprint boxing#61

Merged
TypeThe0ry merged 1 commit into
devfrom
codex/perf-delimited-primitives
Jul 16, 2026
Merged

perf(core): avoid primitive fingerprint boxing#61
TypeThe0ry merged 1 commit into
devfrom
codex/perf-delimited-primitives

Conversation

@TypeThe0ry

Copy link
Copy Markdown
Member

What changed

  • add exact-output boolean, char, and int overloads to DelimitedFingerprintBuilder.field
  • keep the existing object/null, delimiter, raw, and entry-separator semantics unchanged
  • add focused regression coverage for primitive text encoding and fallback behavior

Why

Hot render/HUD signature paths currently route primitive values through field(Object), which boxes them and materializes an intermediate string before appending. The primitive overloads append directly to the existing StringBuilder. The char overload is required so Java widening to int cannot change character output.

Validation

No Gradle, JMH, test, or server workload was run locally, per project policy. GitHub Build/Test is the functional gate. This PR stays draft and must not merge until the base-owned A/B lock fix (#60) lands and the protected fingerprint profile reports PASS_OPTIMIZED; a separate base-owned harness change will also enforce exact JMH output and allocation evidence.

@Arbousier1
Arbousier1 force-pushed the codex/perf-delimited-primitives branch from 7981752 to 4d6f998 Compare July 16, 2026 05:53

Copy link
Copy Markdown
Member Author

Trusted base-owned performance A/B evidence:

  • Run: https://github.com/EllanServer/MahjongEngine/actions/runs/29475512830
  • Base: 610535d49167b47f3808324a06fe17287f167f0c
  • Candidate: 4d6f99899fe9edc6d48819172cecaf11afe1827d
  • Profile: infra (default forks/warmups/measurements; 4 AB + 4 BA pairs)
  • Decision: PASS_OPTIMIZED
  • Time (ns/op, lower is better): paired median improvement 16.6572%; 95% bootstrap CI 14.7750%–17.7400%; 8/8 wins, 0 losses/ties.
  • Allocation (B/op, lower is better): paired median improvement 7.31708% (352.000328.000 B/op); 95% bootstrap CI 7.3170778%–7.3170793%; 8/8 wins, 0 losses/ties.
  • A/A drift control passed.
  • Evidence artifact: performance-ab-infra-610535d49167b47f3808324a06fe17287f167f0c-4d6f99899fe9edc6d48819172cecaf11afe1827d (ID 8366666457, SHA-256 994dbaf5e1e5ef2c1b78f2755f71d2b84d4f8e9a50d7f1383d52f208d3a2e90a).

@TypeThe0ry
TypeThe0ry marked this pull request as ready for review July 16, 2026 06:25
@TypeThe0ry
TypeThe0ry merged commit 28300f7 into dev Jul 16, 2026
15 checks passed
@Arbousier1
Arbousier1 deleted the codex/perf-delimited-primitives branch July 16, 2026 16:55
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.

2 participants