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

Restructured filter for better performance #203

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ellipsis753
Copy link
Contributor

I was profiling my website and tracked back a performance issue to this function, this modification speeds up all my page loads by 0.2s (10%).

The site I work on is quite plugin heavy and presumably makes a lot of calls to get_post_metadata. This triggers this filter which in turn makes lots of fairly slow calls to get_option (which itself checks for several more filters and calls them).

I've re-ordered the function to greatly reduce the number of calls to get_option.

I'm afraid I don't actually know what this filter is for, however this change does not break/affect my website and the code certainly looks equivalent.

I'm sure that most websites don't have as many plugins or make as many calls to meta data. However, I'd very much appreciate it if you merged this change anyway, as I'm sure it will be useful to at least someone out there.

Keep up the good work on the plugin.

Kind regards and all the best,
Shanee Vanstone.

I was profiling my website and tracked back a performance issue to this function, this modification speeds up all my page loads by 0.2s (10%).

The site I work on is quite plugin heavy and presumably makes a lot of calls to get_post_metadata. This triggers this filter which in turn makes lots of fairly slow calls to get_option (which itself checks for several more filters and calls them).

I've re-ordered the function to greatly reduce the number of calls to get_option.

I'm afraid I don't actually _know_ what this filter is for, however this change does not break/affect my website and the code certainly _looks_ equivalent.

I'm sure that most websites don't have as many plugins or make as many calls to meta data. However, I'd very much appreciate it if you merged this change anyway, as I'm sure it will be useful to at least someone out there.

Keep up the good work on the plugin.

Kind regards and all the best,
Shanee Vanstone.
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.

1 participant