Skip to content

[bench] Add AddDoesNotPerformAssertionToNonAssertingTestRector bench on deep parent chains - #824

Merged
TomasVotruba merged 2 commits into
mainfrom
bench-does-not-perform-assertion
Nov 14, 2026
Merged

TomasVotruba merged 2 commits into
mainfrom
bench-does-not-perform-assertion

Conversation

@TomasVotruba

@TomasVotruba TomasVotruba commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Adds a bench for AddDoesNotPerformAssertionToNonAssertingTestRector to compare changes that resolve parent classes via AstResolver, e.g. #822.

It generates 300 test classes (1800 test methods) over 10 parent chains of 4 abstract classes, with setUp()/tearDown() hooks and parent::test*() calls, and measures one cold refactor() pass.

php bench/does_not_perform_assertion_lifecycle_bench.php

Results, CPU over 3 runs:

CPU
main 0.57-0.59 s (0.32 ms/method)
#822 7.5-8.1 s (4.2-4.5 ms/method)

The bench also runs in CI as the Bench job and fails when CPU is over 1 s. On the GitHub runner, main takes 0.23 s.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant