Repository navigation
Conversation
Each rev starts, signals and evicts one workflow. The bench emits ON_FINALLY itself, so it runs on master too.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Benchmark: eviction cost, master vs fix
See #852
Setup.
tests/Benchmark/EvictionBench.phpon branchchore/issue-507-eviction-bench. Each rev starts one workflow, sends a signal, and evicts the workflow withDestroyWorkflow. The run uses the unit worker mock (no RoadRunner, no server), PHP 8.5 with opcache and without xdebug, and 3000 revs × 10 iterations. GC runs only when the router or PHP starts it, as in production. The values are the mode in µs per workflow lifecycle.Promise::allof 3 timersReact\Promise\allof 3 timersWorkflow::asyncscopesthen()chainDeferredWorkflow::await+ signal handlerGC, per 3000 evictions (separate script, only the destroy batch is timed):
Result. On master, each evicted workflow leaves a cycle graph that only the cycle collector can free. The fix frees the workflow at eviction, so a full lifecycle is 22–43% faster. Neither branch has a real leak: a forced GC frees everything on both.
Run:
vendor/bin/phpbench run tests/Benchmark/EvictionBench.php --report=aggregateWhat was changed
Why?
Checklist
Closes
How was this tested: