This PR aims to improve handle performance as discussed in #934
Instead of optimizing handles, they are completely removed and replaced by passing the index of the current thread
This makes it so we can store a slice of phpThreads on the go side and have more potential control over thread
creation/destruction/metrics.
The performance impacts are similar to #934.
A quick worker benchmark:
wrk -t 4 -c 150 -d 60 http://localhost:8124 on WSL bookworm-Docker 20 CPU cores 40 threads
This PR aims to improve handle performance as discussed in #934
Instead of optimizing handles, they are completely removed and replaced by passing the index of the current thread This makes it so we can store a slice of phpThreads on the go side and have more potential control over thread creation/destruction/metrics. The performance impacts are similar to #934.
A quick worker benchmark:
wrk -t 4 -c 150 -d 60 http://localhost:8124
on WSL bookworm-Docker 20 CPU cores 40 threadsNote that this benchmark was done with php_import_environment_variables disabled (I plan to address it in a separate PR).
This PR comes with some necessary refactoring (especially in
worker.go
) so I hope it doesn't conflict too much with other potential PRs.