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 operating locally #17

Closed
bobbingwide opened this issue Feb 25, 2016 · 7 comments
Closed

Improve performance by operating locally #17

bobbingwide opened this issue Feb 25, 2016 · 7 comments
Assignees

Comments

@bobbingwide
Copy link
Owner

Currently the createapi2.php file ( in oik-batch ) runs as a client server process.
Processing would be more efficient if run as a batch process, using a local database.

Proposed solution

Use oik-batch's oik-wp.php to invoke WordPress locally against the oik-shortcodes plugin passing the name of the plugin/theme to load, previous version etc.

oik-shortcodes.php will respond to the action hook "run_oik-shortcodes.php"

@bobbingwide
Copy link
Owner Author

bobbingwide commented Feb 26, 2016

When running PHP from the command line the PHP ini value max_execution_time defaults to 0 - no limit - but calls to set_time_limit() will actually change the value. These calls should not be performed.

@bobbingwide
Copy link
Owner Author

See also bobbingwide/oik-batch#4

@bobbingwide
Copy link
Owner Author

When running locally we need to ensure we don't re-use data created for a previous file or API when creating the next one. The $_POST array and some global variables need to be reset after each file, class or API is created or updated.

As an aside. WordPress does not behave at all well when there are 6 million post_meta rows. I had up to 4,000 post_meta records per post. Oops!

@bobbingwide
Copy link
Owner Author

oiksc_update_oik_hook() needs to be functional when running locally, otherwise hooks won't be created.

@bobbingwide bobbingwide added this to the V1.28.0 or v2.0.0 milestone Mar 17, 2016
@bobbingwide bobbingwide self-assigned this Mar 17, 2016
bobbingwide added a commit that referenced this issue Mar 19, 2016
Increase memory requirements to 2GB
Don't process plugin and theme folder as part of "wordpress" core
bobbingwide added a commit that referenced this issue Mar 19, 2016
bobbingwide added a commit that referenced this issue Mar 19, 2016
@bobbingwide bobbingwide reopened this Mar 26, 2016
@bobbingwide
Copy link
Owner Author

Need to ensure _oik_api_hooks post meta data is updated even when the $oikai_hook array is empty.

@bobbingwide
Copy link
Owner Author

Performance when running locally can be improved by only processing the functions that have actually changed. The average number of functions per file in WordPress is 15. Currently if the file is slightly changed we are reprocessing every function/method.

@bobbingwide
Copy link
Owner Author

I believe this is safe to close now.

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

No branches or pull requests

1 participant