Profiling with xhprof

Profiling with xhprof

by Gareth J Barnard -
Number of replies: 4
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Hello fellow devs,

After reading Tim Hunt's excellent post: https://tjhunt.blogspot.co.uk/2013/05/performance-testing-moodle.html - I went off to https://docs.moodle.org/dev/Setting_up_xhprof_on_Moodle#Installing_xhprof_with_Windows to install the DLL, however, xhprof is no longer developed and I'm running php 5.6 on Windows so there is no DLL for it.  I've found https://tideways.io/profiler/xhprof-for-php7-php5.6 but apparently the API has changed.  So....

  • Are there alternatives on Windows for Moodle?
  • Does the Linux version (sudo apt-get install php5-xhprof etc.) still work with PHP 5.6+?  As I do run Ubuntu virtually.

I'm running Moodle 3.1 which does not have the 'Profiling' page in the development section of site administration - what's replaced it please?

Thanks,

Gareth

Average of ratings: Useful (1)
In reply to Gareth J Barnard

Re: Profiling with xhprof

by Juan Carrera -

Hi Gareth,

I haven't test it, but i've seen a Digital Ocean's post about installing XHProf on Ubuntu 14.04. They also say that if you need support for PHP 7 (they don't say anything about 5.6) you could use tideways profiler [2].

I hope it helps.


[1] https://www.digitalocean.com/community/tutorials/how-to-set-up-xhprof-and-xhgui-for-profiling-php-applications-on-ubuntu-14-04

[2] https://github.com/tideways/php-profiler-extension


Cheers,

Juan

In reply to Juan Carrera

Re: Profiling with xhprof

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Thank you for your reply Juan smile.

I'm having a look and the XHProf and XHGui seem to be for 9.2 version and thus would be PHP 5.4?  I think it might be worth a go as the GUI looks good and Tideways is a paid for entity.

I wonder if MHQ should fork XHProf and maintain it as an element of the testing process, just like so much effort is put into Behat tests.  Something for a Moodle Association vote?

Food for thought!

Kind regards,

Gareth

In reply to Gareth J Barnard

Re: Profiling with xhprof

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Update:

Could not get xhprof to work but have now profiled with xdebug:

https://docs.moodle.org/dev/Profiling_PHP

and

https://xdebug.org/docs/profiler

with the Windows binaries from:

https://xdebug.org/download.php

I was not able to get Wincachegrind to work as it kept complaining about 'Cannot find call target' when opening the profile file.  So found a port of KCacheGrind called QCacheGrind: https://sourceforge.net/projects/qcachegrindwin/ which works.

In reply to Gareth J Barnard

Re: Profiling with xhprof

by Darko Miletić -

xdebug is the way to go. xhprof is abandoned and will not be updated.