fix(#364): run only referenced lints in unlint-non-existing-defect - #1233
Open
VasilevNStas wants to merge 1 commit into
Open
fix(#364): run only referenced lints in unlint-non-existing-defect#1233VasilevNStas wants to merge 1 commit into
VasilevNStas wants to merge 1 commit into
Conversation
Contributor
Author
|
@volodya-lombrozo @yegor256 please review this PR |
Member
|
/benchmark |
Contributor
Benchmark comparison for #1233Comparing this branch against the Biggest changes
Full results (425 entries)
|
VasilevNStas
force-pushed
the
fix/issue-364-unlint-perf
branch
from
August 16, 2026 13:33
29dac85 to
4e0568a
Compare
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.
Fixes #364
Problem: The
unlint-non-existing-defectlint is the slowest one, by an order of magnitude, according to the benchmark. The reason: for every document it randefects()on all lints, even when the document had no+unlintmetas at all.Solution: The lint now collects the
+unlinttails first and, if the document has none, returns an empty result without touching any lint. Otherwise, only the lints whose names are referenced by the+unlintmetas are executed, instead of the full set.Changes:
src/main/java/org/eolang/lints/LtUnlintNonExistingDefect.java: rewrittendefects()to short-circuit on documents without+unlint;existing()filterslintsby the referenced names before callingdefects().src/test/java/org/eolang/lints/LtUnlintNonExistingDefectTest.java: two new tests asserting that no lint runs when there are no+unlintmetas and that unreferenced lints are not invoked (a lint that explodes when called would fail the test).Tests:
mvn clean install -Pqulice— 580 tests, all green.