Skip to content
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

Refator array_map into simple loop for performance #11332

Merged
merged 2 commits into from
Mar 2, 2024

Conversation

beberlei
Copy link
Member

@beberlei beberlei commented Mar 2, 2024

Alternative to more complex performance refactoring in #11316

This already reduces performance overhead measured by Tideways by 56%. It shows again how expensive array_map is vs a simple foreach in performance sensitive code path.

Bildschirmfoto 2024-03-02 um 17 35 22

Related to #11087

@beberlei beberlei changed the title Refator array_map into simple loop. Refator array_map into simple loop for performance. Mar 2, 2024
@beberlei beberlei marked this pull request as ready for review March 2, 2024 16:37
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

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

🤯

Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

TIL

@derrabus derrabus added this to the 2.19.0 milestone Mar 2, 2024
@derrabus derrabus merged commit e62571c into doctrine:2.19.x Mar 2, 2024
58 checks passed
derrabus added a commit to derrabus/orm that referenced this pull request Mar 3, 2024
* 2.19.x:
  Refator array_map into simple loop for performance. (doctrine#11332)
derrabus added a commit that referenced this pull request Mar 3, 2024
* 3.1.x:
  Use class from persistence package  (#11330)
  Refator array_map into simple loop for performance. (#11332)
@derrabus derrabus changed the title Refator array_map into simple loop for performance. Refator array_map into simple loop for performance Mar 3, 2024
@mpdude
Copy link
Contributor

mpdude commented Mar 4, 2024

ties a knot into his handkerchief

@michnovka
Copy link
Contributor

Wouldn't it make sense to ban array_map with phpcs and remove all usage in all places of the code? I see it is used in SqlWalker, BasicEntityPersister, ReflectionPropertiesGetter, hydrators and other places

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.

5 participants