1. 云栖社区>
  2. PHP教程>
  3. 正文

PHPUnit code coverage benchmark

作者:用户 来源:互联网 时间:2017-12-01 09:10:38

PHPUnit code coverage benchmark - 摘要: 本文讲的是PHPUnit code coverage benchmark, PHPUnit code coverage benchmark + Par Remi le lundi 9 novembre 2015, 08:33 -Développement -Lien permanent

<a href=PHPUnit code coverage benchmark"> PHPUnit code coverage benchmark +

Par Remi le lundi 9 novembre 2015, 08:33 -Développement -Lien permanent

PHP phpunit planet-php

As already said numerous time, PHP 7 is faster than PHP 5.

Since PHPUnit 4.8 you can choose between XDebug and phpdbg as driver to retrieve code coverage data, see PHPUnit 4.8: Code Coverage Support .

Here is some benchmark results.

All the tests are run usingPHPUnit 5.0.8,PHP 5.6.15 as SCL orPHP 7.0.0RC6 as SCL and XDebug 2.4.0beta1 (freshly released, with some additional patches) for the composer test suite.

PHP 5 without code coverage $ php56 vendor/bin/phpunit -vRuntime: PHP 5.6.15Time: 4.78 seconds, Memory: 40.25Mb PHP 7 without code coverage $ php70 vendor/bin/phpunit -vRuntime: PHP 7.0.0RC6Time: 3.37 seconds, Memory: 22.00Mb

So, PHP gain 30% of time and 45% of memory.

PHP 5 with code coverage $ php56 vendor/bin/phpunit -vRuntime: PHP 5.6.15 with Xdebug 2.4.0beta1Time: 1.89 minutes, Memory: 90.50Mb PHP 7 with code coverage using XDebug $ php70 vendor/bin/phpunit -vRuntime: PHP 7.0.0RC6 with Xdebug 2.4.0beta1Time: 39.41 seconds, Memory: 52.00Mb

Again PHP 7 is really faster (65% of time, 43% of memory)

PHP 7 with code coverage using phpdbg $ php70-phpdbg -qrr vendor/bin/phpunit -v Runtime: PHPDBG 7.0.0RC6Time: 13.07 seconds, Memory: 92.00Mb

Terribly faster :) 66% of time saved compared to Xdebug, and 89% compared to PHP 5

I notice a lot of people are not aware of the latest solution, what a pity! I hope this will encourage you to test it.

以上是云栖社区小编为您精心准备的的内容,在云栖社区的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索,以便于您获取更多的相关知识。