a limited subset of PHP to a native binary running faster than PHP. Walk-through: benchmarking PHP vs KPHP vs C++ PHP code: quicksort algorithm このコードを利用して、純粋なPHPの速度比較を行います。 16
static function xdebugOutputDir() { $dir = ini_get('xdebug.profiler_output_dir'); if ($dir=='') // Ini value not defined return realpath(Webgrind_Config::$profilerDir).'/'; return realpath($dir).'/'; } 20
Using host libthread_db library "/lib64/libthread_db.so.1". Core was generated by `php index.php'. Program terminated with signal SIGSEGV, Segmentation fault. #0 ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER () at /tmp/php-build/source/8.0.0/Zend/zend_vm_execute.h:1917 1917 if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) { [Current thread is 1 (Thread 0x7fcae7405c80 (LWP 25999))] (gdb) bt #0 ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER () at /tmp/php-build/source/8.0.0/Zend/zend_vm_execute.h:1917 #1 0x000000000080f3ab in execute_ex (ex=0x7fcadd413300) at /tmp/php-build/source/8.0.0/Zend/zend_vm_execute.h:54545 #2 0x00007fcadce8a16e in xdebug_execute_ex (execute_data=0x7fcadd4130f0) at /tmp/php-build/source/xdebug-3.0.1/src/base/base.c:802 #3 0x000000000045a0e9 in ZEND_DO_FCALL_SPEC_OBSERVER_HANDLER () at /tmp/php-build/source/8.0.0/Zend/zend_vm_execute.h:1938 #4 0x000000000080f3ab in execute_ex (ex=0x7fcadd413300) at /tmp/php-build/source/8.0.0/Zend/zend_vm_execute.h:54545 #5 0x00007fcadce8a16e in xdebug_execute_ex (execute_data=0x7fcadd413020) at /tmp/php-build/source/xdebug-3.0.1/src/base/base.c:802 #6 0x0000000000815a00 in zend_execute (op_array=0x7fcadd473100, return_value=0x0) at /tmp/php-build/source/8.0.0/Zend/zend_vm_execute.h:58856 #7 0x00000000007b4cda in zend_execute_scripts (type=type@entry=8, retval=retval@entry=0x0, file_count=file_count@entry=3) at /tmp/php-build/source/8.0.0/Zend/zend.c:1680 #8 0x0000000000759a30 in php_execute_script (primary_file=primary_file@entry=0x7ffed1e21f10) at /tmp/php-build/source/8.0.0/main/main.c:2488 #9 0x00000000008384b9 in do_cli (argc=2, argv=0x303d1f0) at /tmp/php-build/source/8.0.0/sapi/cli/php_cli.c:949 #10 0x00000000004614bb in main (argc=2, argv=0x303d1f0) at /tmp/php-build/source/8.0.0/sapi/cli/php_cli.c:1336 22
a limited subset of PHP to a native binary running faster than PHP. Walk-through: benchmarking PHP vs KPHP vs C++ PHP code: quicksort algorithm このコードを利用して、純粋なPHPの速度比較を行います。 24
in 1442.352ms Sorted 1000000 elements in 1453.989ms Sorted 1000000 elements in 1545.674ms Sorted 1000000 elements in 1423.958ms memory_get_usage ->32.38MByte ▪PHP8.0.0 Sorted 1000000 elements in 1397.739ms Sorted 1000000 elements in 1349.728ms Sorted 1000000 elements in 1388.148ms Sorted 1000000 elements in 1342.53ms Sorted 1000000 elements in 1381.239ms memory_get_usage ->32.34MByte 27
in 43173.084ms pg_connect 1000 times in 44172.276ms ▪JITなし pg_connect 1000 times in 45814.642m pg_connect 1000 times in 45438.385ms pg_connect 1000 times in 45806.33ms RDBの処理が支配的であるため、処理改善が非常に小さい DiskStorageなどが絡んでしまうとPHP8のJITの効果は極小化してしまう 36