From 224d3e8262ed6156ea3374fe91dfb5b66d6f0d3a Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 16 Aug 2026 16:24:38 +0900 Subject: 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) --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) (limited to 'Cargo.toml') diff --git a/Cargo.toml b/Cargo.toml index 75a88e65..e0e8b892 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,6 +37,7 @@ futures = "0.3.32" indexmap = { version = "2.14.0", features = ["serde"] } jsonschema = { version = "0.46.6", default-features = false } md5 = "0.7.0" +memchr = "2.8.3" mockall = "0.14.0" nix = { version = "0.31.3", features = ["feature", "fs", "poll", "process", "signal", "user"] } regex = "1.12.3" -- cgit v1.3.1-4-g156e