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

Too long TSC calibration #57

Open
validname opened this issue Dec 15, 2014 · 4 comments
Open

Too long TSC calibration #57

validname opened this issue Dec 15, 2014 · 4 comments

Comments

@validname
Copy link

Xhprof finds out how many TSC ticks goes into 5 ms period. And it does it for each core. It lasts 120 ms on our 24-core server, much more than PHP takes executing the script!
Maybe exists any way to do this calibration only for different physical CPUs (not all cores)?

@beberlei
Copy link

@validname See this fork of XHProf where I impelemented this https://github.com/QafooLabs/php-profiler-extension

@validname
Copy link
Author

@beberlei Thank you!
Actually, I've already wrote several dirty patches to improve XHprof performance on Linux.
But it still eats a lot of CPU when enabled, so I'm trying to find another profiler. Do you have some measurements of your profiler's overhead?

@beberlei
Copy link

@validname The overhead is comparable to XHProf because it is a fork, but we implemented a bunch of ways to improve it:

  1. Use 'functions' => array('PDO::exec', ...) as a whitelist of methods to profile.
  2. Use qafoolabs_layers_enable(array('PDO::exec' => 'db', 'curl_exec' => 'http') which only profiles a list of functions and aggregates them by layer.
  3. Use the QAFOOPROFILER_FLAGS_NO_USERLAND or QAFOOPROFILER_FLAGS_NO_BUILTINS flags.

We are working on a slightly different approach to profiling that is much faster, but it is not nearly production ready yet.

Would you care to share your patches? I would be interested in the improvement ideas you had.

@validname
Copy link
Author

@beberlei Sorry for long answer.
My patches are in my fork: validname@0ede447 and validname@c50540d.
They both are concerned with PHP extension performance, that was primary goal to improve it. But I'm not an experienced developer and hadn't dealt with cross-platform code compiling so my patches will probably work only with my couple of Linux/glibc and kernel.
But we are using patched XHProf extension in our company now and have no problem except overhead (about 8-10% of average CPU usage with 50% of total CPU usage, that gives about 20% of overhead. But original extension works with 20-25% of overhead).

remicollet pushed a commit to remicollet/xhprof that referenced this issue Jul 5, 2021
Set SVG render as default for callgraph.php
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

2 participants