happyaccidents/benchmarking-dependency-injection-containers — pull request #1 by mnapoli (2013-03-16 16:01:23+00:00)
Title: Added PHP-DI to the list + Loops for averaging benchmarks

Hi there!

I was curious about the performances so I added PHP-DI to the benchmarks.

I also added loops for each benchmarks so that the time is averaged.

I'm sorry I should have made 2 separate pull request but I didn't really planned it at first. I tried to match you code guidelines and not to make a mess, feel free to comment the code.

Also a note: I added the loops but I'm not sure if all the containers have the same behavior. For example PHP-DI will "resolve" an instance, but then share it (i.e. same as singleton), so once the instance is resolved future calls for getting this instance will be very light. If some containers return a new instance each time, that's of course not the same behavior and it's not a good thing to compare performances.

So I believe it can explain that PHP-DI scores relatively good with the loops, even though I never expected it to have very good performances (especially one the one with annotations). However PHP-DI also supports some caching and it's not used here, so anyway these benchmarks are just to give an idea.