Nyholm / psr7

A super lightweight PSR-7 implementation
MIT License
1.15k stars 75 forks source link

Improve performance of creating streams from strings #241

Closed nicolas-grekas closed 1 year ago

nicolas-grekas commented 1 year ago

Using https://github.com/devanych/psr-http-benchmark, I figured out that for strings smaller than ~200k, php://memory is faster than the custom zval stream. Past this threshold, zval stream is way faster thanks to copy-on-write.