Skip to content

Avoid redundant per-call work in blink reporter and phpdoc typo fixer - #186

Merged
TomasVotruba merged 1 commit into
mainfrom
blink-perf-group
Oct 9, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
blink-perf-group

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Two small, independent performance cleanups. No behavior change.

  • reporter.relativePath called os.Getwd() once per reported file, inside the diff loop. The cwd is now resolved once before the loop and passed in; an empty cwd falls back to the original path, as before.
  • fpntFixTypos recompiled its @param ... <name> regex on every call. The pattern depends only on the typo name, so it is now memoized per name in a concurrency-safe cache.

The larger O(n^2) token-stream rework is handled separately in its own PR.

relativePath called os.Getwd() for every reported file; resolve the cwd
once before the loop and pass it in. fpntFixTypos recompiled its @PARAM
pattern on every call; memoize the per-typo-name regex.
@TomasVotruba
TomasVotruba merged commit 69f6eff into main Oct 9, 2026
21 checks passed
@TomasVotruba
TomasVotruba deleted the blink-perf-group branch October 9, 2026 09:38
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.

1 participant