Skip to content

Conversation

@mvorisek
Copy link
Contributor

@mvorisek mvorisek commented May 21, 2024

as requested in #110 (comment)

@mvorisek mvorisek marked this pull request as ready for review May 21, 2024 09:49
@mvorisek mvorisek changed the title Dedup indent level decrease Dedup indent level decrease code May 21, 2024
@greg0ire greg0ire requested a review from goetas May 21, 2024 18:54
@greg0ire
Copy link
Member

Fix slow array_unshift/shift, appending is faster

Have you been able to measure a meaningful difference in our case?

@mvorisek mvorisek force-pushed the dedup_decrement_indent_level branch from cfdb633 to 5f66188 Compare May 22, 2024 21:19
@mvorisek mvorisek force-pushed the dedup_decrement_indent_level branch from 5f66188 to a89a573 Compare May 22, 2024 21:20
@mvorisek
Copy link
Contributor Author

Now I did - https://3v4l.org/eFdHL/rfc#vgit.master_jit - array shift/unshift is simply very costly and should never be used if appending is an option. Even with a small element count.

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.

Looking at the execution time of the test suite, it seems faster as well.
Before
After

It's not exactly scientific, but since your changes don't make the code harder to read, I'd say let's go with that.

@greg0ire greg0ire added the enhancement New feature or request label May 23, 2024
@greg0ire greg0ire added this to the 1.5.0 milestone May 23, 2024
@greg0ire greg0ire merged commit db72b86 into doctrine:1.5.x May 23, 2024
@greg0ire
Copy link
Member

Thanks @SenseException !

@mvorisek mvorisek deleted the dedup_decrement_indent_level branch May 23, 2024 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants