Skip to content

[roottest] Refactor custom_diff.py#21587

Merged
hageboeck merged 2 commits intoroot-project:masterfrom
hageboeck:custom_diff
Mar 13, 2026
Merged

[roottest] Refactor custom_diff.py#21587
hageboeck merged 2 commits intoroot-project:masterfrom
hageboeck:custom_diff

Conversation

@hageboeck
Copy link
Member

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.

Copy link
Contributor

@guitargeek guitargeek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much!

@github-actions
Copy link

github-actions bot commented Mar 12, 2026

Test Results

    22 files      22 suites   3d 5h 9m 36s ⏱️
 3 810 tests  3 809 ✅ 1 💤 0 ❌
76 756 runs  76 747 ✅ 9 💤 0 ❌

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.
@hageboeck hageboeck merged commit 790beb5 into root-project:master Mar 13, 2026
29 of 30 checks passed
@hageboeck hageboeck deleted the custom_diff branch March 13, 2026 17:22
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.

2 participants