clue · GitHub

This changeset refactors the Response class to build on top of a new PSR-7 implementation. This brings us one step closer to eventually replace the dated RingCentral implementation (#331) and eventually support PSR-7 v2 (#513). This is a purely internal change that comes with 100% code coverage and does not otherwise affect the public API, so it should be safe to apply.

As a side effect, this appears to show a minor, but noticeable, performance improvement during my benchmarks:

$ php examples/99-server-benchmark-download.php 127.0.0.1:8080
$ docker run -it --rm --net=host jordi/ab -n100000 -c100 -k http://localhost:8080/
# old: 48428 requests per second
# new: 51288 requests per second

(Also posted in https://twitter.com/another_clue/status/1767924579908174213)

Once merged, I'll file follow-up PRs to refactor the Request and ServerRequest classes (#480 and #170) accordingly. If you enjoy this change and want to help us continue to ship more improvements, consider supporting this project, for example by becoming a sponsor ❤️

Builds on top of #432, #370, #480 and others

Read the original on github.com ↗