You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9ff0e4f
Browse filesBrowse the repository at this point in the historyBrowse files
Speed up project-patch and purl checks (#1607) (#1701)
* Start fix for #1607
Assisted-by: Claude Code:claude-opus-5-5
* Speed up the project-patch check on big locks
Every scan checks the project for its own patches (Yarn patch:
locators, patch-package scripts) before touching a package, and
hosted scans check again under the write lock. On a large Yarn Berry
lock that check split every line of yarn.lock to find the few
resolution lines that carry a patch: locator, and it recompiled the
two patch-package regexes each time.
Now it jumps straight to the "@patch:" occurrences and compiles the
regexes once, only for a project whose scripts run patch-package.
What it finds is unchanged. On the yarn-berry/rescan bench fixture
this cuts about 20M instructions (~2%) from each scan.
Refs #1607
Assisted-by: Claude Code:claude-opus-5-5
* Check canonical purls a byte at a time
Scans key every crawled package's purl several times, and each key
first checks whether the purl is already canonical. That check
looked for '?', '#' and '%' by decoding every character. Scanning
bytes gives the same answer (all three are ASCII, and no multi-byte
UTF-8 character contains an ASCII byte) for a fraction of the cost:
about 10M fewer instructions per yarn-berry/rescan bench run.
Refs #1607
Assisted-by: Claude Code:claude-opus-5-5
* Guard the patch-line search against stalls
The helper that finds yarn.lock lines holding a patch: locator now
moves past each line it returns, so a needle that is empty or holds
a newline can't keep matching the same spot. A test pins the
documented line-ending rules instead of only comparing against
str::lines.
Refs #1607
Assisted-by: Claude Code:claude-opus-5-5
---------
Co-authored-by: Claude <noreply@anthropic.com>
0 commit comments