objectionary / objectionary/lints

`unlint-non-existing-defect` excessively re-runs XSL transformations, causing major performance issue

Open
#1,389 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug good-title
Dominant language
Java
Stars
14
Forks
39
Avg merge
22h 54m
Merged PRs (30d)
90

Description

Problem

unlint-non-existing-defect is by far the slowest lint (14513 ms on the XXL benchmark, ~10x the next one), because it re-runs every lint's XSL transformation for every +unlint name instead of reusing the defects already computed by the main pass.

Root cause

src/main/java/org/eolang/lints/LtUnlintNonExistingDefect.java:114-123:

private Set<String> existing(final String name) {
    return this.lints.stream()
        .filter(l -> l.name().equals(name))
        .flatMap(l -> l.defects(this.xml).stream())   // raw lint, no cache
        .map(Defect::line)
        ...
}

existing() calls lint.defects(xmir) on the raw lints (not wrapped in LtDfSticky), so for every +unlint foo the full XSL transformation for foo runs again — duplicating the work already done in the main pipeline where the same lint is wrapped in LtDfSticky. The results are thrown away right after the DefectMissing check.

Expected behavior

Reuse the defects from the main pass (or share the LtDfSticky-wrapped instances), so +unlint validation does not double the XSL workload. Estimated impact: the XXL timing should drop to the same order as the other lints.

Related

  • PkMono.java — where lints get their LtUnlint/LtDfSticky decorations.
  • #1349 (volodya) — coverage of this lint; complementary.
  • README benchmark table shows the current 14513 ms figure.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/main/java/org/eolang/lints/LtUnlintNonExistingDefect.java:114-123 and inspect PkMono.java to understand the LtUnlint and LtDfSticky decorations. Use the #1349 coverage and README XXL benchmark as validation points; done means +unlint validation reuses main-pass results and the benchmark no longer shows the excessive XSL transformation time.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
performance, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.