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

xpdo::getOption performance improvement #74

Merged
merged 4 commits into from Sep 18, 2015
Merged

xpdo::getOption performance improvement #74

merged 4 commits into from Sep 18, 2015

Conversation

ronaldex
Copy link

Only call more expensive function 'array_key_exists' when 'isset' fails, leads to ca 15-20% performance increases for server response time in our specific modx site.

(skipping 'array_key_exists' leads to an extra 5-10% performance increase but would change the result if the value is null)

@opengeek
Copy link
Member

This is a great optimization. I wonder what impact skipping the check altogether would really have...

@ronaldex
Copy link
Author

I've done some testing with an simplified version without all te checks and server response times are ca. 40-50% of the original response times!

@ronaldex
Copy link
Author

New simplified version (improves server response times ca. 60% compared to original code)

@opengeek opengeek self-assigned this Sep 18, 2015
@opengeek opengeek merged commit 88c1590 into modxcms:2.x Sep 18, 2015
@opengeek
Copy link
Member

This is merged into 2.x, 2.4.x and 3.x — nice optimization and thanks again for the excellent contribution!

opengeek added a commit that referenced this pull request Sep 22, 2015
Merge remote-tracking branch 'origin/pr/75' into 2.4.x

* origin/pr/75:
  xpdo::getOption fix skipEmpty logic (v3: performance tweak)
  xpdo::getOption fix skipEmpty logic (v2)
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.

None yet

3 participants