Skip to content

[bench] Add FileInfoMatcher::matchPattern realpath benchmark - #8703

Merged
TomasVotruba merged 1 commit into
mainfrom
tv-bench-file-info-matcher
Oct 18, 2026
Merged

TomasVotruba merged 1 commit into
mainfrom
tv-bench-file-info-matcher

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Adds a standalone bench for FileInfoMatcher::matchPattern(), matching the existing bench/* scripts.

It exercises the matchRealpath() fall-through with wildcard patterns whose realpath() is always false. PHP does not cache a failed realpath() lookup, so without a per-pattern cache each file pays a filesystem syscall per pattern.

Measures the change in #8699 (realpath cache). Local run, 150 files x 3 patterns x 40 repeats:

  • without cache: cpu 0.0639s
  • with cache: cpu 0.0398s (~38% faster)

Run on both branches to compare:

php bench/file_info_matcher_bench.php

@TomasVotruba
TomasVotruba merged commit 1a92e78 into main Oct 18, 2026
49 checks passed
@TomasVotruba
TomasVotruba deleted the tv-bench-file-info-matcher branch October 18, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant