Repository navigation
Conversation
matthi4s
approved these changes
Nov 13, 2026
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.
PatternAnalyser::analyse()calledgetPatterns()again for every entry and insight class, and passed the entry object topreg_match_all(), soEntry::__toString()joined all lines of the entry once per pattern.Patterns are now resolved once per analysis and every entry is converted to a string once.
Analysing all 229 test logs of codex-minecraft goes from about 500 ms to about 195 ms with unchanged results.
To do this without passing an entry and its text side by side, the analysis is split by responsibility:
analyse()resolves the patterns and adds the insights of every entry to the analysisanalyseEntry()handles one entry against all patterns and holds the entry text as a local variablefindMatches()only knows a pattern and a textcreateInsight()builds the insight for one matchBreaking changes
analyseEntry()has a new signature:analyseEntry(EntryInterface $entry, array $patternsByClass): array.It is called once per entry instead of once per pattern and always returns an array instead of
null.Subclasses that override it have to be adapted; codex-minecraft, codex-minecraft-clientmod, codex-minecraft-fabricclient and codex-hytale don't override it and pass their tests unchanged.
Before, it matched twice and doubled the counter of its insights.
Decisions
analyse()call and not cached statically, so changes to the possible insight classes or their patterns still take effect.Entryitself, becauseLine::setText()is public and doesn't know its entry, so the cache could not be invalidated.preg_match_all()returnsfalseis still skipped silently, as before.Reporting these errors is left for a separate PR.
Changes
resolvePatterns(),findMatches()andcreateInsight()toPatternAnalyseranalyseEntry()to analyse one entry against all patternsfindPossibleInsightClass()