-
Notifications
You must be signed in to change notification settings - Fork 29
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
Profiling an intermediate hook is sometimes empty #126
Comments
This is a bug in PHP 7 https://bugs.php.net/bug.php?id=72966 Related thread from another profiling plugin khromov/wp-performance-profiler#1 |
One of the comments in https://bugs.php.net/bug.php?id=71448 mentioned the following:
Maybe this issue can be resolved by recoding how intermediate hooks work with PHP7.1? |
Yeah, after running into this now, and going through the PHP bug discussion - it actually was a bug in PHP5, and PHP7 fixed the leak. Looks like |
Is there another way to profile the (for example) |
PHP 5.6 is the only option. |
So currently this won't work on PHP 7.1+ either, correct? (But could be made to work?) |
Hello, |
Assuming you have WP-CLI and the profile command installed, you can apply the patch with the following one-liner: wget -qO- https://gist.githubusercontent.com/danielbachhuber/6bc4276ce559ddaa8b809a17c5ad6cd5/raw/9ca11c146c88f481367494e62eb940835b0bcd95/wp-cli-profile-command-160.diff | patch -p1 -d ~/.wp-cli/packages/vendor/wp-cli/profile-command/ However, bear in mind that the patch by @danielbachhuber isn't complete and there are missing parts. Specifically, the For example, WordPress when loading the translation files (
Also, this leaves find . -name '*_file.php' -delete |
When profiling an intermediate hook (e.g.
wp profile hook plugins_loaded:before
), some environments don't log any results:In debugging this initial report, the callback hooked into
register_tick_function()
is only fired once.The text was updated successfully, but these errors were encountered: