[roottest] Refactor custom_diff.py#21587
Merged
hageboeck merged 2 commits intoroot-project:masterfrom Mar 13, 2026
Merged
Conversation
3 tasks
Test Results 22 files 22 suites 3d 5h 9m 36s ⏱️ Results for commit 17c5256. ♻️ This comment has been updated with latest results. |
Instead of specifying regexes lazily inside the line filter loop, precompile them by instantiating a filter class. In this way, adding a new filter or replacement can be done by adding a single line, and the regexes run a tiny bit faster.
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.
For #18083, I wanted to add a regex to the custom_diff script. I thought it would be nice to collect all suppressions and replacements in one single place, and precompile the regexes before starting to apply the filter.
The speed gains are small, since the script only runs < 1s typically, but now one can add further filters/replacements by adding one single line instead of having to deal with if/else/continue.
This also was a good opportunity to "ruff" it up a little bit.