-
Notifications
You must be signed in to change notification settings - Fork 1
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 startup performance of _oik-bwtrace-mu.php #109
Comments
Figures for plugin load times on blocks.wp-a2z.org show _oik-bwtrace-mu.php taking 0.05 seconds.
|
oik-bwtrace settings are updated by
So we could add code into these sanitization routines. The hook name includes the option name, which means we can hook into each of the settings individually. This is preferable to hooking into the |
The callback function The performance logic will be enabled when the Trace file > Enable performance trace checkbox is set. So long as other tests pass:
The value of the Initialisation
Processing until shutdown
Processing on 'shutdown'
|
It appears that the figures I reported earlier were wrong..
The elapsed time between WordPress does quite a lot of loading between these two points. To get a better understanding of the time taken to initialise tracing I added another timing point run at the start of _oik-bwtrace-mu.
and for the case where _oik-bwtrace-mu isn't being loaded at the start of oik-bwtrace the same code appears at the start of oik-bwtrace/oik-bwtrace.php This new timing point gives a better indication of the time spent initialising tracing. |
I tried this in
I didn't implement any logic dealing with backtrace. |
The current logic loads the options using WordPress's |
Note: PHPUnit tests need updating for different values of the Enable performance trace checkbox. |
In s.b/cwiccer I'm getting the following Fatal when using the block editor.
|
The PHPUnit tests need to be updated for the changes in 95f024d - Load options from JSON files if available. Tests_oik_bwtrace::test_bw_trace_plugin_startup_tracing_off C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\tests\test--oik-bwtrace.php:324 or
C:\apache\htdocs\wordpress\wp-content\plugins\oik-bwtrace\tests\test--oik-bwtrace.php:271 |
Currently, after running PHPUnit tests for oik-bwtrace, things get a bit out of sync in the .json files. When using To re-enable tracing the .json files need to be deleted and recreated.
The logic that synchronises one .json file when an option set is updated ( see |
With bwtrace v3.4.2 on wp-pompey.org.uk there were several messages due to the
This problem was due to the new code in the |
Delivered in v3.4.3 |
In the performance reports I produced for cwiccer.com the Plugin load times post indicates that
_oik-bwtrace-mu.php
takes 0.04 of a second to get started.This is significantly greater than other plugins:
Requirement
Reduce the overhead of tracing when it's being used to analyse server performance
Proposed solution
Investigate solutions to reduce the load time when tracing is being invoked for performance reasons.
The text was updated successfully, but these errors were encountered: