Pārlūkot izejas kodu

CPU profiling test

Viacheslav Poturaev 6 gadi atpakaļ
vecāks
revīzija
1d5d53e3b2

+ 100 - 0
test/php_cpu_uprofiler_56.json

@@ -0,0 +1,100 @@
+{
+  "main()==>load::php_cpu.php": {
+    "ct": 1,
+    "wt": 85,
+    "cpu": 0,
+    "mu": 3456,
+    "pmu": 0
+  },
+  "nestedCPU@4==>nestedCPU@5": {
+    "ct": 1,
+    "wt": 8,
+    "cpu": 0,
+    "mu": 768,
+    "pmu": 0
+  },
+  "nestedCPU@3==>nestedCPU@4": {
+    "ct": 1,
+    "wt": 3617,
+    "cpu": 15625,
+    "mu": 2040,
+    "pmu": 0
+  },
+  "nestedCPU@2==>nestedCPU@3": {
+    "ct": 1,
+    "wt": 6869,
+    "cpu": 15625,
+    "mu": 3312,
+    "pmu": 0
+  },
+  "nestedCPU@1==>nestedCPU@2": {
+    "ct": 1,
+    "wt": 10197,
+    "cpu": 15625,
+    "mu": 4584,
+    "pmu": 0
+  },
+  "nestedCPU==>nestedCPU@1": {
+    "ct": 1,
+    "wt": 14148,
+    "cpu": 15625,
+    "mu": 5848,
+    "pmu": 0
+  },
+  "run_init::code\/php_cpu.php==>nestedCPU": {
+    "ct": 1,
+    "wt": 18268,
+    "cpu": 31250,
+    "mu": 7136,
+    "pmu": 0
+  },
+  "main()==>run_init::code\/php_cpu.php": {
+    "ct": 1,
+    "wt": 18273,
+    "cpu": 31250,
+    "mu": 8448,
+    "pmu": 0
+  },
+  "{closure}::\/prepend.php\/4-36==>register_shutdown_function": {
+    "ct": 1,
+    "wt": 5,
+    "cpu": 0,
+    "mu": 1032,
+    "pmu": 0
+  },
+  "main()==>{closure}::\/prepend.php\/4-36": {
+    "ct": 1,
+    "wt": 11,
+    "cpu": 0,
+    "mu": 2504,
+    "pmu": 0
+  },
+  "{closure}::\/prepend.php\/5-35==>phpversion": {
+    "ct": 2,
+    "wt": 4,
+    "cpu": 0,
+    "mu": 848,
+    "pmu": 0
+  },
+  "{closure}::\/prepend.php\/5-35==>uprofiler_disable": {
+    "ct": 1,
+    "wt": 0,
+    "cpu": 0,
+    "mu": 792,
+    "pmu": 0
+  },
+  "main()==>{closure}::\/prepend.php\/5-35": {
+    "ct": 1,
+    "wt": 51,
+    "cpu": 0,
+    "mu": 3024,
+    "pmu": 968
+  },
+  "main()": {
+    "ct": 1,
+    "wt": 18482,
+    "cpu": 31250,
+    "mu": 17752,
+    "pmu": 1904
+  }
+}

+ 72 - 0
test/php_cpu_v4_72.json

@@ -0,0 +1,72 @@
+{
+  "nestedCPU@4==>nestedCPU@5": {
+    "ct": 1,
+    "wt": 3,
+    "cpu": 0,
+    "mu": 848,
+    "pmu": 0
+  },
+  "nestedCPU@3==>nestedCPU@4": {
+    "ct": 1,
+    "wt": 1446,
+    "cpu": 0,
+    "mu": 1440,
+    "pmu": 0
+  },
+  "nestedCPU@2==>nestedCPU@3": {
+    "ct": 1,
+    "wt": 2882,
+    "cpu": 0,
+    "mu": 2032,
+    "pmu": 0
+  },
+  "nestedCPU@1==>nestedCPU@2": {
+    "ct": 1,
+    "wt": 4052,
+    "cpu": 0,
+    "mu": 2624,
+    "pmu": 0
+  },
+  "nestedCPU==>nestedCPU@1": {
+    "ct": 1,
+    "wt": 5223,
+    "cpu": 15625,
+    "mu": 3208,
+    "pmu": 0
+  },
+  "main()==>nestedCPU": {
+    "ct": 1,
+    "wt": 6420,
+    "cpu": 15625,
+    "mu": 3792,
+    "pmu": 0
+  },
+  "{closure}==>register_shutdown_function": {
+    "ct": 1,
+    "wt": 1,
+    "cpu": 0,
+    "mu": 568,
+    "pmu": 0
+  },
+  "main()==>{closure}": {
+    "ct": 2,
+    "wt": 10,
+    "cpu": 0,
+    "mu": 2408,
+    "pmu": 0
+  },
+  "{closure}==>tideways_disable": {
+    "ct": 1,
+    "wt": 1,
+    "cpu": 0,
+    "mu": 848,
+    "pmu": 0
+  },
+  "main()": {
+    "ct": 1,
+    "wt": 6553,
+    "cpu": 15625,
+    "mu": 7352,
+    "pmu": 19480
+  }
+}

+ 72 - 0
test/php_cpu_v4_73.json

@@ -0,0 +1,72 @@
+{
+  "nestedCPU@4==>nestedCPU@5": {
+    "ct": 1,
+    "wt": 2,
+    "cpu": 0,
+    "mu": 848,
+    "pmu": 0
+  },
+  "nestedCPU@3==>nestedCPU@4": {
+    "ct": 1,
+    "wt": 1225,
+    "cpu": 0,
+    "mu": 1440,
+    "pmu": 0
+  },
+  "nestedCPU@2==>nestedCPU@3": {
+    "ct": 1,
+    "wt": 2417,
+    "cpu": 0,
+    "mu": 2032,
+    "pmu": 0
+  },
+  "nestedCPU@1==>nestedCPU@2": {
+    "ct": 1,
+    "wt": 3614,
+    "cpu": 0,
+    "mu": 2624,
+    "pmu": 0
+  },
+  "nestedCPU==>nestedCPU@1": {
+    "ct": 1,
+    "wt": 4810,
+    "cpu": 0,
+    "mu": 3208,
+    "pmu": 0
+  },
+  "main()==>nestedCPU": {
+    "ct": 1,
+    "wt": 6025,
+    "cpu": 0,
+    "mu": 3792,
+    "pmu": 0
+  },
+  "{closure}==>register_shutdown_function": {
+    "ct": 1,
+    "wt": 1,
+    "cpu": 0,
+    "mu": 568,
+    "pmu": 0
+  },
+  "main()==>{closure}": {
+    "ct": 2,
+    "wt": 8,
+    "cpu": 0,
+    "mu": 2408,
+    "pmu": 0
+  },
+  "{closure}==>tideways_disable": {
+    "ct": 1,
+    "wt": 0,
+    "cpu": 0,
+    "mu": 848,
+    "pmu": 0
+  },
+  "main()": {
+    "ct": 1,
+    "wt": 6158,
+    "cpu": 0,
+    "mu": 7320,
+    "pmu": 19800
+  }
+}

+ 72 - 0
test/php_cpu_v5_72.json

@@ -0,0 +1,72 @@
+{
+  "main()==>{closure}": {
+    "ct": 1,
+    "wt": 5,
+    "cpu": 0,
+    "mu": 608,
+    "pmu": 0
+  },
+  "{closure}==>tideways_xhprof_disable": {
+    "ct": 1,
+    "wt": 2,
+    "cpu": 0,
+    "mu": 128,
+    "pmu": 0
+  },
+  "nestedCPU@2==>nestedCPU@3": {
+    "ct": 1,
+    "wt": 2341,
+    "cpu": 0,
+    "mu": 576,
+    "pmu": 0
+  },
+  "nestedCPU@1==>nestedCPU@2": {
+    "ct": 1,
+    "wt": 3509,
+    "cpu": 0,
+    "mu": 800,
+    "pmu": 0
+  },
+  "main()": {
+    "ct": 1,
+    "wt": 6017,
+    "cpu": 15625,
+    "mu": 2840,
+    "pmu": 0
+  },
+  "nestedCPU==>nestedCPU@1": {
+    "ct": 1,
+    "wt": 4699,
+    "cpu": 15625,
+    "mu": 1024,
+    "pmu": 0
+  },
+  "nestedCPU@4==>nestedCPU@5": {
+    "ct": 1,
+    "wt": 1,
+    "cpu": 0,
+    "mu": 128,
+    "pmu": 0
+  },
+  "main()==>nestedCPU": {
+    "ct": 1,
+    "wt": 5896,
+    "cpu": 15625,
+    "mu": 1248,
+    "pmu": 0
+  },
+  "{closure}==>register_shutdown_function": {
+    "ct": 1,
+    "wt": 2,
+    "cpu": 0,
+    "mu": 160,
+    "pmu": 0
+  },
+  "nestedCPU@3==>nestedCPU@4": {
+    "ct": 1,
+    "wt": 1174,
+    "cpu": 0,
+    "mu": 352,
+    "pmu": 0
+  }
+}

+ 72 - 0
test/php_cpu_v5_73.json

@@ -0,0 +1,72 @@
+{
+  "main()==>{closure}": {
+    "ct": 1,
+    "wt": 5,
+    "cpu": 0,
+    "mu": 608,
+    "pmu": 0
+  },
+  "{closure}==>tideways_xhprof_disable": {
+    "ct": 1,
+    "wt": 1,
+    "cpu": 0,
+    "mu": 128,
+    "pmu": 0
+  },
+  "nestedCPU@2==>nestedCPU@3": {
+    "ct": 1,
+    "wt": 2416,
+    "cpu": 0,
+    "mu": 576,
+    "pmu": 0
+  },
+  "nestedCPU@1==>nestedCPU@2": {
+    "ct": 1,
+    "wt": 3713,
+    "cpu": 0,
+    "mu": 800,
+    "pmu": 0
+  },
+  "main()": {
+    "ct": 1,
+    "wt": 6240,
+    "cpu": 0,
+    "mu": 2808,
+    "pmu": 0
+  },
+  "nestedCPU==>nestedCPU@1": {
+    "ct": 1,
+    "wt": 4901,
+    "cpu": 0,
+    "mu": 1024,
+    "pmu": 0
+  },
+  "nestedCPU@4==>nestedCPU@5": {
+    "ct": 1,
+    "wt": 1,
+    "cpu": 0,
+    "mu": 128,
+    "pmu": 0
+  },
+  "main()==>nestedCPU": {
+    "ct": 1,
+    "wt": 6122,
+    "cpu": 0,
+    "mu": 1248,
+    "pmu": 0
+  },
+  "{closure}==>register_shutdown_function": {
+    "ct": 1,
+    "wt": 1,
+    "cpu": 0,
+    "mu": 160,
+    "pmu": 0
+  },
+  "nestedCPU@3==>nestedCPU@4": {
+    "ct": 1,
+    "wt": 1224,
+    "cpu": 0,
+    "mu": 352,
+    "pmu": 0
+  }
+}

+ 86 - 0
test/php_cpu_xhprof_56.json

@@ -0,0 +1,86 @@
+{
+  "main()==>load::php_cpu.php": {
+    "ct": 1,
+    "wt": 215,
+    "cpu": 0,
+    "mu": 3448,
+    "pmu": 0
+  },
+  "nestedCPU@4==>nestedCPU@5": {
+    "ct": 1,
+    "wt": 6,
+    "cpu": 0,
+    "mu": 768,
+    "pmu": 0
+  },
+  "nestedCPU@3==>nestedCPU@4": {
+    "ct": 1,
+    "wt": 3541,
+    "cpu": 15625,
+    "mu": 1840,
+    "pmu": 0
+  },
+  "nestedCPU@2==>nestedCPU@3": {
+    "ct": 1,
+    "wt": 6861,
+    "cpu": 15625,
+    "mu": 2896,
+    "pmu": 0
+  },
+  "nestedCPU@1==>nestedCPU@2": {
+    "ct": 1,
+    "wt": 10278,
+    "cpu": 15625,
+    "mu": 3952,
+    "pmu": 0
+  },
+  "nestedCPU==>nestedCPU@1": {
+    "ct": 1,
+    "wt": 13726,
+    "cpu": 15625,
+    "mu": 5000,
+    "pmu": 0
+  },
+  "???_op==>nestedCPU": {
+    "ct": 1,
+    "wt": 22886,
+    "cpu": 31250,
+    "mu": 6048,
+    "pmu": 0
+  },
+  "main()==>???_op": {
+    "ct": 1,
+    "wt": 22893,
+    "cpu": 31250,
+    "mu": 7120,
+    "pmu": 0
+  },
+  "{closure}==>register_shutdown_function": {
+    "ct": 1,
+    "wt": 1,
+    "cpu": 0,
+    "mu": 1016,
+    "pmu": 0
+  },
+  "main()==>{closure}": {
+    "ct": 2,
+    "wt": 8,
+    "cpu": 0,
+    "mu": 3632,
+    "pmu": 0
+  },
+  "{closure}==>xhprof_disable": {
+    "ct": 1,
+    "wt": 0,
+    "cpu": 0,
+    "mu": 792,
+    "pmu": 0
+  },
+  "main()": {
+    "ct": 1,
+    "wt": 23229,
+    "cpu": 31250,
+    "mu": 14048,
+    "pmu": 0
+  }
+}

+ 2 - 2
test/run_cpu.sh

@@ -6,6 +6,6 @@ docker run --rm -e REPORT=php_cpu_v5_72.json -v $(pwd):/code phperf/php-profiler
 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
+docker run --rm -e REPORT=php_cpu_xhprof_56.json -v $(pwd):/code phperf/php-profiler:5.6-xhprof php php_cpu.php
+docker run --rm -e REPORT=php_cpu_uprofiler_56.json -v $(pwd):/code phperf/php-profiler:5.6-uprofiler php php_cpu.php