Skip to content

fix(#978): speed up bytes-without-data lint#1016

Open
ext11n7 wants to merge 2 commits into
objectionary:masterfrom
ext11n7:bytes-without-data
Open

fix(#978): speed up bytes-without-data lint#1016
ext11n7 wants to merge 2 commits into
objectionary:masterfrom
ext11n7:bytes-without-data

Conversation

@ext11n7

@ext11n7 ext11n7 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Optimizes the bytes-without-data lint by replacing expensive XPath predicates with a cheaper structural check.

Instead of evaluating eo:has-data() and eo:abstract() for every matching node, the lint now selects only nodes that:

  • are children of Φ.bytes
  • have no @base
  • have no non-empty text content

Why

The previous XPath was too slow on large XMIR files.

On the benchmark source set, bytes-without-data improved on XXL from 138ms to 69ms, which brings it below the 100ms threshold from the issue.

Validation

  • benchmark suite passed
  • XSL test suite passed

@ext11n7 ext11n7 force-pushed the bytes-without-data branch 5 times, most recently from b5839e8 to 2f23aa5 Compare July 6, 2026 14:25
@ext11n7 ext11n7 force-pushed the bytes-without-data branch from 2f23aa5 to b28283f Compare July 6, 2026 14:27
@ext11n7

ext11n7 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

@yegor256

@yegor256

yegor256 commented Jul 6, 2026

Copy link
Copy Markdown
Member

@volodya-lombrozo check it please

@yegor256 yegor256 requested a review from volodya-lombrozo July 6, 2026 17:24
@0crat

0crat commented Jul 7, 2026

Copy link
Copy Markdown

@ext11n7 It is not a good idea to name Git branches the way you named this one: "bytes-without-data". You've earned -6 points. Next time, better give your branch the same name as the number of the ticket that you are solving. In this case, a perfect name, for example, would be "1015". Your running score is +4; don't forget to check your Zerocracy account too).

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.

3 participants