-
-
Notifications
You must be signed in to change notification settings - Fork 515
Add types for benchmarks #2948
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
Add types for benchmarks #2948
Conversation
GromNaN
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR modernizes the benchmark suite by adding proper type declarations and migrating from annotation-based to attribute-based PhpBench configuration.
- Migrated from
@BeforeMethodsannotations to#[BeforeMethods]attributes - Added type declarations to all properties and methods in benchmark classes
- Moved
#[BeforeMethods]from parent class to child classes to maintain correct execution order
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| benchmark/BaseBench.php | Removed annotation-based @BeforeMethods and added type declaration for $documentManager property |
| benchmark/Document/StoreDocumentBench.php | Added #[BeforeMethods] attribute with proper method ordering |
| benchmark/Document/LoadDocumentBench.php | Added #[BeforeMethods] attribute with all required methods, added type declarations for $userId property and loadDocument() method |
| benchmark/Document/HydrateDocumentBench.php | Added #[BeforeMethods] attribute with all required methods, added type declarations for all properties |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@GromNaN important note here - looks like we are only running Performance Tests against PHP 8.1 so they are not using native lazy objects. |
Good point, we can switch to CI to 7.4. |
Summary
Add missing types in Benchmarks and use
#[BeforeMethod]attribute consistently.