perf: guard hot-path logger.warn on the consensus thread (CONV-1)#118
Merged
Conversation
…(CONV-1) Logger.warn(String, Object...) builds the varargs Object[] and boxes its primitive args (plus any OrderRejectReason.describe(...) string) at the call site BEFORE warn()'s own level check, so every Engine reject-path warn allocated on the consensus thread even at the default ERROR level where nothing prints — exactly during a reject storm. Add Logger.isWarn() and guard all ten reject / could-not-rest warn sites with `if (logger.isWarn()) logger.warn(...)`, so the argument list is only built when WARN logging is enabled. At ERROR level these paths now allocate nothing. Updates the hot-path-allocations audit. Closes #117 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CfrBZ6nUcBkWzMq8FioNSP
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.
Phase 0 · CONV-1 — see POST-SPRINT-REMEDIATION-PLAN.md
The custom
Logger.warn(String, Object...)builds the varargsObject[]and boxes its primitive args (plus any eagerOrderRejectReason.describe(...)string) at the call site, beforewarn()'s own level guard. The default level is ERROR, so everyEnginereject-path warn allocated on the consensus thread even though nothing was printed — precisely during a reject storm, which the repo's ownhot-path-allocations.mdflags and the zero-alloc hot-path priority forbids.Change:
Logger.isWarn().logger.warn(...)sites inEngine.javawithif (logger.isWarn()) logger.warn(...), so the argument list is built only when WARN is enabled. At ERROR level these paths now allocate nothing.hot-path-allocations.mdreject-path entry (FIXED).No behavior change to the reject paths. Engine tests green:
EngineTest(42),EnginePublisherIntegrationTest(23),DirectMatchingEngineTest(21) — 86 total, 0 failures. Deploy needs a rolling restart to pick up the engine jar.Closes #117
🤖 Generated with Claude Code