php-router-benchmark
php-router-benchmark copied to clipboard
[WIP] Add Dash router to benchmarks
Requested by @ocramius #1
As for that service locator requirement: You can simply implement the route collection interface with a simple implementation for your benchmark.
@DASPRiD Heh, apologies for missing that.
I implemented a custom RouteCollection and everything is working fantastic, but I'm curious about the results. I'm hoping you would take a look at how I'm setting things up -- perhaps I've made a mistake?
Well, first off, you always only test the matching performance, and completely ignore the instantiation. This is kinda important, since usually for every match you also have the instantiation time (one match per request). This already makes it a little unfair, since Dash is quite performant in regard to that; see the following benchmark:
https://github.com/DASPRiD/RouterBenchmark
Apart from that, your benchmark makes absolutely no use of some of the key features of Dash, which involve heavy lazy loading and re-using of resources.
Thanks, @DASPRiD. You're right, I am only testing matching performance. I do intend to extend the tests to cover instantiation and caching and whatever else-- just needed a place to start.
I will take a look at your benchmark to see some ways I can leverage Dash's features in these tests. Thanks again!