Conversation
SupaYoshi
force-pushed
the
fix/avoid-exception-driven-condition-parsing
branch
from
August 28, 2026 15:49
88149e1 to
3773a93
Compare
Collaborator
|
looks fine for me |
Owner
|
seems good, approved. thanks! |
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.
Problem
Condition.parseValue(...)currently triesInteger.parseInt(...)and thenDouble.parseDouble(...)for every operand. CaughtNumberFormatExceptionis therefore the normal control-flow path for every text condition.For example, evaluating
full == fullcreates four caught exceptions: two numeric parse attempts for each of the two valid string operands. This is especially costly when conditions are refreshed frequently for online players.A bounded 90-second JFR from a low-load Paper server recorded:
NumberFormatException.forInputString(...);FloatingDecimal.check(...);fulland 726 forcompact.That is 16,100 caught numeric parse exceptions in 90 seconds for ordinary string placeholder values. The raw production recording is intentionally not attached because it can contain server-specific runtime data.
Change
Double.parseDouble(...).This removes exceptions from the expected string path without changing condition syntax or operators.
Compatibility covered by tests
contains, andstartsWith, includingfullandcompact;InfinityandNaNsemantics.The full Maven reactor build passes on current
masterwith all tests green.I also applied the same source change locally to the exact v1.5.8 tag. A local JFR-backed test evaluated 200,000 text conditions and recorded zero
Condition.parseValue/ numeric parsing exception signatures. Nothing from this RealScoreboard patch was deployed to the production server.Scope