-
-
Notifications
You must be signed in to change notification settings - Fork 251
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
Lock free handles #934
Lock free handles #934
Conversation
Tests are failing for some reason, I'll investigate. |
I went ahead and merged #933 into this PR to run a benchmark. It looks like this makes worker/cgi-mode have the same performance characteristics. |
Don't merge/review (unless you want to). I submitted a CL to Go and getting good feedback. Already, the CL version is 20-40% faster than this version and doesn't require any changes to the Handles api. |
3a558f6
to
b4a53d1
Compare
Co-authored-by: Kévin Dunglas <[email protected]>
Co-authored-by: Kévin Dunglas <[email protected]>
@withinboredom I've been experimenting a bit with passing The basic idea is to keep a sync map on the go side like this:
This allows us eliminate all handles and generally feels like a simpler approach. It might also make extracting metrics easier, since we keep a reference to all requests currently going through the threads. |
Yes! I don't think you even need a |
Interesting, I didn't know |
|
Replaced by #1073. |
This takes the Handles from the CL I submitted to Go and applies them here. The changes are not that big to the FrankenPHP parts; though I did also remove the "smart pointer" stuff. We just need to be careful to delete handles.
Here's the performance difference for worker mode, visualized by ChatGPT after feeding it 10 benchmarks each:
This is approximately a 9-13% increase in RPS using a very simple PHP script.
I also wrote about the changes to Handles on my blog