frankenphp
frankenphp copied to clipboard
perf: move sandboxed environment to the C side
This PR uses zend_array_dup to simplify the environment sandboxing logic. It removes the CGO overhead from $_ENV and $_SERVER registration in regular threads and saves some memory on many threads. (wip)
| Quick Benchmark | Main | This PR |
|---|---|---|
| BenchmarkHelloWorld-20 | 7071 | 7482 |
| BenchmarkEcho-20 | 12160 | 12098 |
| BenchmarkServerSuperGlobal-20 | 5550 | 5829 |
| BenchmarkUncommonHeaders-20 | 6444 | 6709 |