TomBZombie/php-dependency-injection-benchmarks — pull request #4 by fprochazka (2014-08-09 21:47:17+00:00)
Title: Nette Framework benchmark

I've created benchmark also for Nette Framework. It doesn't have a "add service by classname on the fly" capability, because in real-world applications, there is no place for that. In real world applications, you need to DI Container to be as fast as possible, so yes, this is the way this DI Container is used. And In fact, it's the most effecient way :)

This is the output of new `running.php` if I run it on my local mashine

--------

## Running aura

| # | Time (ms) | Files | Memory usage (mb) |
| -:| ---------:| -----:| -----------------:|
| 1 | 0.1776 | 9 | 0.3969 |
| 2 | 0.1575 | 9 | 0.3973 |
| 3 | 2.0785 | 9 | 0.4217 |
| 4 | 0.0401 | 9 | 0.3974 |
| 5 | 0.2216 | 9 | 0.3990 |

## Running dice

| # | Time (ms) | Files | Memory usage (mb) |
| -:| ---------:| -----:| -----------------:|
| 1 | 0.1448 | 3 | 0.3198 |
| 2 | 0.1084 | 3 | 0.3205 |
| 3 | 2.0242 | 3 | 0.3647 |
| 4 | 0.0525 | 3 | 0.3215 |
| 5 | 0.2864 | 3 | 0.3248 |

## Running nette-di

| # | Time (ms) | Files | Memory usage (mb) |
| -:| ---------:| -----:| -----------------:|
| 1 | 0.0191 | 12 | 0.5733 |
| 2 | 0.0184 | 12 | 0.5736 |
| 3 | 0.0189 | 12 | 0.5952 |
| 4 | 0.0199 | 12 | 0.5736 |
| 5 | 0.0199 | 12 | 0.5750 |

## Running nette-di-compiled

| # | Time (ms) | Files | Memory usage (mb) |
| -:| ---------:| -----:| -----------------:|
| 1 | 0.0195 | 15 | 0.7012 |
| 2 | 0.0178 | 15 | 0.7013 |
| 3 | 0.0186 | 15 | 0.7089 |
| 4 | 0.0193 | 15 | 0.7013 |
| 5 | 0.0207 | 15 | 0.7013 |

## Running orno

| # | Time (ms) | Files | Memory usage (mb) |
| -:| ---------:| -----:| -----------------:|
| 1 | 0.2537 | 7 | 0.3781 |
| 2 | 0.2796 | 7 | 0.3786 |
| 3 | 2.5573 | 7 | 0.3890 |
| 4 | 0.0574 | 5 | 0.3455 |
| 5 | 0.3140 | 7 | 0.3797 |

## Running php-di

| # | Time (ms) | Files | Memory usage (mb) |
| -:| ---------:| -----:| -----------------:|
| 1 | 1.5244 | 44 | 1.0576 |
| 2 | 1.4688 | 44 | 1.0583 |
| 3 | 24.3472 | 46 | 1.1017 |
| 4 | 0.0573 | 40 | 1.0093 |
| 5 | 2.4034 | 46 | 1.0772 |

## Running symfonydi

| # | Time (ms) | Files | Memory usage (mb) |
| -:| ---------:| -----:| -----------------:|
| 1 | 1.1733 | 10 | 0.7736 |
| 2 | 1.1519 | 10 | 0.7745 |
| 3 | 14.9577 | 11 | 0.8043 |
| 4 | 0.1501 | 10 | 0.7704 |
| 5 | 1.8345 | 11 | 0.7839 |

## Running zend-di

| # | Time (ms) | Files | Memory usage (mb) |
| -:| ---------:| -----:| -----------------:|
| 1 | 2.5488 | 26 | 1.0665 |
| 2 | 2.5358 | 26 | 1.0668 |
| 3 | 82.8558 | 27 | 1.2817 |
| 4 | 0.5742 | 26 | 1.0668 |
| 5 | 1.4971 | 27 | 1.1004 |