Skip to content

Restructured filter for better performance#203

Open
Ellipsis753 wants to merge 1 commit intodesignwall:masterfrom
Ellipsis753:patch-2
Open

Restructured filter for better performance#203
Ellipsis753 wants to merge 1 commit intodesignwall:masterfrom
Ellipsis753:patch-2

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