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
README notes ~0.2s baseline to parse and compile a file in bin/jit.php. For web requests, compile-on-every-run dominates unless using AOT (phpc build / phpc serve --aot).
examples/001-SimpleWeb benchmark table shows bin/jit.php ~0.11s vs ./compiled ~0.0016s runtime — production path is AOT; JIT cold compile still matters for #207phpc serve --jit and dev workflows.
Goal
Measurable compile-time reduction for typical single-file web scripts (<200 lines), targeting <50ms cold compile on reference hardware (document baseline in issue/PR).
Problem
README notes ~0.2s baseline to parse and compile a file in
bin/jit.php. For web requests, compile-on-every-run dominates unless using AOT (phpc build/phpc serve --aot).examples/001-SimpleWebbenchmark table showsbin/jit.php~0.11s vs./compiled~0.0016s runtime — production path is AOT; JIT cold compile still matters for #207phpc serve --jitand dev workflows.Goal
Measurable compile-time reduction for typical single-file web scripts (<200 lines), targeting <50ms cold compile on reference hardware (document baseline in issue/PR).
Implementation hints
Measure first
script/bench-compile.php(new)make benchProfile hot paths:
lib/Compiler.php— avoid redundant recompilation of unchanged fileslib/JIT.php— module creation,PHPLLVMcontext initlib/JIT.pre/ opcode loweringOptimization ideas (prioritized)
phpccache dir keyed bysha256(file)+compilerVersion)ext/standardhot builtins once per processDeployment guidance (docs)
phpc build+phpc serve --aotor CGI binary (Web: CGI/1.1 request driver (stdin/stdout, env, Status line) #50)--jitwhen Web: JIT/AOT mode for bin/serve.php (compile per script on first request) #207 landsAcceptance criteria
script/bench-compile.phpprints before/after table forexamples/001-SimpleWeb/example.phpin README or comment on this issue.Target: documented reduction (e.g. 200ms → <50ms) OR explicit rationale why target deferred (with #153 cache as recommended path).
Verification (local / Docker only)
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev php script/bench-compile.phpNo GitHub Actions.
Dependencies
Related