Summary
zphp should include a profiler for finding expensive PHP code and runtime bottlenecks.
For example:
or:
zphp profile serve app.php
Useful metrics
Track:
- function execution time
- call counts
- self time vs total time
- allocations
- allocated bytes
- peak memory
- GC activity
- VM/opcode execution
- blocking I/O time
- worker/thread usage
- Fiber scheduling time
Example output:
Function Calls Self Total
World::tick 2000 420ms 780ms
encodeChunk 800 300ms 310ms
Player::tick 50000 250ms 400ms
Optional output formats could include:
- text
- JSON
- Chrome Trace
- flamegraph-compatible data
Profiling should have minimal overhead when disabled.
Summary
zphp should include a profiler for finding expensive PHP code and runtime bottlenecks.
For example:
or:
Useful metrics
Track:
Example output:
Optional output formats could include:
Profiling should have minimal overhead when disabled.