Skip to content

Benchmark packet-field allocation and off-path CPU - #25

Merged
GrowlyX merged 2 commits into
masterfrom
perf/packet-field-regression-benchmarks
Nov 7, 2026
Merged

GrowlyX merged 2 commits into
masterfrom
perf/packet-field-regression-benchmarks

Conversation

@GrowlyX

@GrowlyX GrowlyX commented Nov 7, 2026

Copy link
Copy Markdown

Field-storage changes can reduce allocations or speed repeated protocol stages while slowing packets that only decode once. The latest experiments reproduced that tradeoff, including JIT inlining changes that a replay-only fixture missed.

Add a standalone allocation/CPU benchmark covering empty and wrong capacity hints, full and partial replays, 4,096-field growth, overlapping rewinds and raw-input-only decoding. Compare identical fixture bytecode against baseline production classes in separate JVMs and print the actual loaded wrapper location. Add regression coverage for subclass read overrides, zero-hint late writes, buffer passthrough and mismatch consumption.

No production packet implementation changes. The performance guide includes a small archived, unapplied full-ring experiment and its complete fork data to reproduce why it was rejected: replay improved, but raw decoding regressed. Allocation stayed unchanged.

Validation: all 119 default common/Bukkit tests and the universal jar build pass; all 110 common tests also pass with Netty4.2.9. The benchmark Gradle task runs with JDK25 against baseline classes and JDK21 against current classes. The archived patch applies cleanly to the unchanged packet implementation. These are local fixtures, with no live deployment or production-gain claim.

@greptile-apps

greptile-apps Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Low impact] The changes affect a local benchmark and packet-field tests, not production packet handling.

The PR appears safe to merge, with a non-blocking gap in the benchmark's overlapping-copy coverage.

Findings

  1. P2 Overlapping copies go unmeasured ▶

Summary

Adds a standalone packet-field benchmark and regression tests without changing production packet code.

  • Developers can compare packet-field costs across baseline and candidate builds.
  • Packet-field tests now cover zero hints and forwarding edge cases.

Reviews (1) · Last reviewed commit: "test: benchmark packet-field allocation ..." · Reviewed by Greptile

@GrowlyX
GrowlyX merged commit df6532d into master Nov 7, 2026
2 checks passed
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