Skip to content

Instantly share code, notes, and snippets.

@dstogov
Created July 19, 2018 11:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dstogov/b9fc0fdccfb8bf7bae121ce3d3ff1db1 to your computer and use it in GitHub Desktop.
Save dstogov/b9fc0fdccfb8bf7bae121ce3d3ff1db1 to your computer and use it in GitHub Desktop.
Real-life becnhmarks (master vs patch)
======================================
master typed diff
blog 169 168 -0.77%
fw 818 809 -1.10%
qdig 716 716 0.04%
scrum 517 502 -2.84%
ZF1 Hello 2,637 2,605 -1.23%
ZF2 Test 675 667 -1.13%
wordpress-3.6 373 368 -1.47%
drupal-7.27 560 539 -3.77%
SugarCRM 470 453 -3.68%
magento-home 90 90 0.45%
magento-cat 30 30 -0.67%
drupal-8.0.0 860 867 0.81%
mediawiki 114 107 -6.39%
wordpress-4.1 346 344 -0.69%
symfony_demo 661 660 -0.24%
Syntetic becnhmarks (master vs patch vs patch + type hints)
===========================================================
master typed typed+hints
empty_loop 0.026 0.026 0.026
$x = self::$x 0.090 0.118 0.117
self::$x = $n 0.086 0.094 0.108
isset(self::$x) 0.075 0.091 0.092
empty(self::$x) 0.072 0.095 0.095
$x = Foo::$x 0.069 0.081 0.079
Foo::$x = $n 0.068 0.054 0.071
isset(Foo::$x) 0.053 0.051 0.051
$x = $this->x 0.128 0.126 0.105
$this->x = $n 0.057 0.059 0.065
$this->x += 2 0.096 0.098 0.120
++$this->x 0.074 0.081 0.082
--$this->x 0.075 0.082 0.082
$this->x++ 0.075 0.083 0.082
$this->x-- 0.074 0.082 0.084
isset($this->x) 0.078 0.076 0.076
empty($this->x) 0.083 0.083 0.082
$ref = $n 0.056 0.054 0.093
@akalongman
Copy link

In future benchmarks, please add Laravel as well

@TomasVotruba
Copy link

Thanks for this! 👍

Do you have the repository with analysis somewhere?

@shirshak55
Copy link

@akalongman why? Laravel is one of my favorite framework and I always use it and I appreciate Taylor but PHP is language and should be independent of framework etc. By doing this we are discouraging competition among framework etc.

@mclassic
Copy link

He's listing other frameworks, CRMs and CMS's, so why not add Laravel? By your principle those other ones should be removed too.

@andrerom
Copy link

andrerom commented Sep 26, 2018

Would also be interesting to see the potentially notable* performance increase any code will get, when moving from using magic methods for properties typing (using __get() __set() et.al) to this.

In order for most projects to move away from them, hopefully readonly properties also arrives in one way or the other in 7.4.

* magic methods has at least in older PHP versions known to be very slow compared to normal method calls or normal property access.

@kauanslr
Copy link

@shirshak55 But the idea is know the performance of the applications using the new changes, as @mclassic say he's listing other frameworks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment