diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-16 16:24:38 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-16 17:34:46 +0900 |
| commit | 224d3e8262ed6156ea3374fe91dfb5b66d6f0d3a (patch) | |
| tree | 5e21148a1192f9f24ebbd2b007f2b9a8a8f8cc37 /scripts/plugin-class-classifier/src/BodyAnalyzer.php | |
| parent | 494f79d0caf614325408d82d5c7a58f9e4396590 (diff) | |
| download | php-shirabe-224d3e8262ed6156ea3374fe91dfb5b66d6f0d3a.tar.gz php-shirabe-224d3e8262ed6156ea3374fe91dfb5b66d6f0d3a.tar.zst php-shirabe-224d3e8262ed6156ea3374fe91dfb5b66d6f0d3a.zip | |
perf(php-shim): scan the phar stub token with memchr
The stub token search compared every 18-byte window of the file case
insensitively. The token starts with a byte that ASCII case folding
leaves alone, so memchr can pick out the candidate offsets and leave
only those to the case-insensitive compare.
Over the 35 MB executable, finding the token in the embedded bundle
stub drops from 2.3 ms to 0.1 ms, and a scan that finds nothing drops
from 24 ms to 3.6 ms.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'scripts/plugin-class-classifier/src/BodyAnalyzer.php')
0 files changed, 0 insertions, 0 deletions
