Skip to content

fix(#984): speed up incorrect-bytes-format lint#1017

Open
ext11n7 wants to merge 2 commits into
objectionary:masterfrom
ext11n7:incorrect-bytes-format
Open

fix(#984): speed up incorrect-bytes-format lint#1017
ext11n7 wants to merge 2 commits into
objectionary:masterfrom
ext11n7:incorrect-bytes-format

Conversation

@ext11n7

@ext11n7 ext11n7 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What this PR does

This PR speeds up the incorrect-bytes-format lint.

The main optimization is in incorrect-bytes-format.xsl:

  • narrows the selection to leaf o nodes only
  • removes unnecessary string-join(...) calls
  • replaces a more expensive regex-based validation with a cheaper structural check for byte tokens

Why

The lint was spending too much time scanning nodes and validating byte strings in a costly way during benchmark runs.
This change keeps the behavior the same while reducing the amount of work done per matched object.

Validation

  • relevant functional tests passed
  • benchmark was re-run after the change
  • incorrect-bytes-format became noticeably faster than before

@ext11n7 ext11n7 force-pushed the incorrect-bytes-format branch from f916ae6 to 70aef89 Compare July 6, 2026 14:49
@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 take a look 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: "incorrect-bytes-format". 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 "1016". Your running score is +10; 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