router icon indicating copy to clipboard operation
router copied to clipboard

[Question] Benchmark

Open higoka opened this issue 7 years ago • 6 comments

Are there any benchmarks available?

higoka avatar Nov 19 '17 12:11 higoka

No, there are no benchmarks available.

If there were, what would you like to see benchmarked?

bramus avatar Nov 19 '17 13:11 bramus

Would be nice to see benchmarks for: first route, last route, unknown route matching.

higoka avatar Nov 19 '17 13:11 higoka

It'd be perfectly possible to run these, yet I'm wondering if they're useful without any context: Speeds will vary per machine and server setup (HTTP Server, PHP version, etc), so they'll need to be compared to other routers before the numbers can make any sense.

But some other routers do more than "just route", they may also include some form of templating, some Request/Response related classes, etc. — so the processing time of those parts should be excluded when comparing, or does one just leave it as is?

Looking forward to hearing your (further) input on this.

bramus avatar Nov 19 '17 13:11 bramus

I agree. It should be excluded.

higoka avatar Nov 19 '17 13:11 higoka

Well, that kinda makes it a somewhat difficult to create, as it requires knowledge of how exactly the other routers work …

On a sidenote: I've found https://github.com/c9s/router-benchmark whilst researching this topic. Perhaps that repo could act as a starting point for a benchmark.

bramus avatar Nov 19 '17 16:11 bramus

I think you can check this https://github.com/jails/php-router-benchmark

abmmhasan avatar Mar 10 '18 10:03 abmmhasan