Skip to content

Conversation

@IonBazan
Copy link
Member

@IonBazan IonBazan commented Dec 1, 2025

Q A
Type improvement
BC Break no (internal classes only)
Fixed issues #2945 (comment)

Summary

Add missing types in Benchmarks and use #[BeforeMethod] attribute consistently.

Important note here: I had to move #[BeforeMethods] only to the child classes as it appears that using PHP Attributes changes the order of execution of these methods when tagging both base and child classes - it previously executed parent first, now executes child first which breaks these benchmarks.

@IonBazan IonBazan self-assigned this Dec 1, 2025
@IonBazan IonBazan requested review from GromNaN and Copilot December 1, 2025 09:29
@IonBazan IonBazan added this to the 2.16.0 milestone Dec 1, 2025
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@GromNaN GromNaN added the Task label Dec 1, 2025
@GromNaN GromNaN enabled auto-merge (squash) December 1, 2025 09:31
Copy link

Copilot AI left a 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 @BeforeMethods annotations 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.

@IonBazan
Copy link
Member Author

IonBazan commented Dec 1, 2025

@GromNaN important note here - looks like we are only running Performance Tests against PHP 8.1 so they are not using native lazy objects.

@GromNaN
Copy link
Member

GromNaN commented Dec 1, 2025

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.

@GromNaN GromNaN merged commit 292d890 into doctrine:2.16.x Dec 1, 2025
27 of 28 checks passed
@IonBazan IonBazan added the Typing label Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants