@@ -3,6 +3,7 @@
register_shutdown_function(
function () {
register_shutdown_function(function () {
+ echo "Uprofiler: ", phpversion("uprofiler"), ", PHP: ", phpversion(), "\n";
$data = uprofiler_disable();
echo 'Nodes in report: ' . count($data) . "\n";
$name = getenv('REPORT');
@@ -4,6 +4,7 @@ register_shutdown_function(
$data = tideways_disable();
+ echo "Tideways: ", phpversion("tideways"), ", PHP: ", phpversion(), "\n";
if (empty($name)) {
$data = tideways_xhprof_disable();
+ echo "TidewaysXHPROF: ", phpversion("tideways_xhprof"), ", PHP: ", phpversion(), "\n";
$data = xhprof_disable();
+ echo "XHPROF: ", phpversion("xhprof"), ", PHP: ", phpversion(), "\n";
@@ -0,0 +1,15 @@
+<?php
+
+function nestedCPU($limit)
+{
+ if ($limit === 0) {
+ return;
+ }
+ $n = 0;
+ for ($i = 0; $i < 100000; $i++) {
+ $n = $n ^ $i;
+ nestedCPU($limit - 1);
+}
+nestedCPU(5);
@@ -0,0 +1,11 @@
+#!/bin/bash
+docker run --rm -e REPORT=php_cpu_v4_72.json -v $(pwd):/code phperf/php-profiler:7.2-tideways-v4 php php_cpu.php
+docker run --rm -e REPORT=php_cpu_v5_72.json -v $(pwd):/code phperf/php-profiler:7.2-tideways-v5 php php_cpu.php
+docker run --rm -e REPORT=php_cpu_v4_73.json -v $(pwd):/code phperf/php-profiler:7.3-tideways-v4 php php_cpu.php
+docker run --rm -e REPORT=php_cpu_v5_73.json -v $(pwd):/code phperf/php-profiler:7.3-tideways-v5 php php_cpu.php
+docker run --rm -e REPORT=php_cpu_xhprof_56.json -v $(pwd):/code phperf/php-profiler:xhprof php php_cpu.php
+docker run --rm -e REPORT=php_cpu_uprofiler_56.json -v $(pwd):/code phperf/php-profiler:uprofiler php php_cpu.php