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

Improve performance by switching from in_array() to isset() #90

Merged
merged 1 commit into from
Sep 22, 2019
Merged

Improve performance by switching from in_array() to isset() #90

merged 1 commit into from
Sep 22, 2019

Conversation

andrey-legayev
Copy link
Contributor

Hi,

I've found that performance of in_array() for 3 elements is much worse than isset() and implemented the fix for saveString() method.
I've found this place in code while profiling Magento2 static content deployment procedure.
Improvement is very small, but the function called a lot of times according to xdebug profiling output (55k times in my case)

Andrey.

@tedivm tedivm merged commit f1bbf84 into tedious:master Sep 22, 2019
@tedivm
Copy link
Member

tedivm commented Sep 22, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants