Benjamin Benjamin 28.12.2017

Releasing New Tideways XHProf Extension

We have just pushed the beta of a new version 5.0 of our XHProf fork to Github. It is rewritten from scatch with a modern code-base that makes use of PHP 7 internals and includes major datastructure improvements.

Tests with a Wordpress installation show callgraph profiling overhead to decrease by 20-50% for this new extension. The extension also moves several data transformation out of your applications hot execution path so that individual function calls should have more accurate measurements.

Your own improvements may vary based on your code base, hardware and usage patterns, but every use-case should have significantly less overhead than before.

Separating XHProf and Tideways extensions

With the 5.0 version of the Tideways PHP extension, we are separating the open-source extension to generate XHProf compatible profiling data from our own timeline/tracing Profiler, so we can work on improving them independently.

This is why the now released Tideways XHProf open-source extension has a new name tideways_xhprof, while the existing extension name tideways will continue to be used for our software as a service / product.

As an open-source user of Tideways, an upgrade to the new version requires you to slightly change your code to adjust for the new extension and function names:

 <?php

-if (extension_loaded('tideways')) {
-    tideways_enable(TIDEWAYS_FLAGS_CPU | TIDEWAYS_FLAGS_MEMORY | TIDEWAYS_FLAGS_NO_SPANS);
-    tideways_disable();
+if (extension_loaded('tideways_xhprof')) {
+    tideways_xhprof_enable(TIDEWAYS_XHPROF_FLAGS_CPU | TIDEWAYS_XHPROF_FLAGS_MEMORY);
+    tideways_xhprof_disable();
 }

In addition the extension needs to be loaded by its new name extension=tideways_xhprof.so.

We are sorry this separation couldn't be done in a backwards compatible way. You can keep using the old tideways extension from the 4.x branch of Github, but we will not update it for new PHP versions anymore and you don't benefit from the performance improvements.

One immediate benefit arising from this is Windows support for all versions of PHP 7.0, 7.1 and 7.2 for both NTS and ZTS. You can even download pre-compiled binaries from AppVeyor Artifacts tab of each build.

Because parts of this code-base is shared with our own new tideways extension and we want to continue to give back an open-source based PHP Profiler to the community, you can expect us to continue the support of this extension in the future. We plan to extend its compatibility to more platforms and adapt it to Zend Engine changes for future PHP versions.

No changes for Tideways Customers

Are you a tideways.io customer? Then nothing changes for you. Install and upgrade the tideways extension from our list of prebuilt packages on the download page. You can find the old extensions source code in the 4.x branch on Github. The tideways-php dpkg and rpm packages from our package repositories will always ship only the tideways extension used with the service.

The new tideways version 5.0 extension will be released in the next weeks and we will make a dedicated announcement about this release and all its improvements.