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

Performance: improve performance of oik autoload #229

Open
bobbingwide opened this issue Jul 4, 2024 · 0 comments
Open

Performance: improve performance of oik autoload #229

bobbingwide opened this issue Jul 4, 2024 · 0 comments

Comments

@bobbingwide
Copy link
Owner

A performance problem was detected in oik autoload in the gvg_bulk_update plugin.
bobbingwide/gvg_bulk_update#18

Here's an extract from the issue

The problem that occured was due to the fact that All In One SEO is checking for the existance of the bbPress class for each post that it's handling to create the AIOSEO Overview box in the WordPress dashboard.
gvg_bulk_update implements a class autoload function that attempts to locate and load the required class.
This functionality is provided by a shared library originally developed for oik.

Both All In One SEO and the shared library are to blame for the performance issue. I hope that by improving the autoload logic the elapsed time will decrease enough to allow AIOSEO to populate the Overview metabox successfully.

Any fix applied here should be backported to oik and oik-libs.

Proposed solution
Return early when subsequent calls for the same class are detected.

Note: This will not fix the problem in AIOSEO.
There's also the possibility that other plugins that implement autoload may also be using up valuable resources for each call to class_exists( 'bbPress' )... and all the other classes that are being autoloaded.

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

No branches or pull requests

1 participant