Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Response class to build on top of new PSR-7 implementation #518

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

clue
Copy link
Member

@clue clue commented Mar 13, 2024

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

@clue clue added this to the v1.10.0 milestone Mar 13, 2024
Copy link
Member

@SimonFrings SimonFrings left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

Copy link
Member

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants