Closed Komosa closed 9 years ago
If you can build a well-working router suitable for real-world applications, we will try to find a way to include it in the benchmark. But it has to handle the same incoming request URLs like the other routers.
My approach should work well, but I need some constrains on URLs. Colon is simplest, but ugly for some and just non-compatible for others :) - it is fine.
There is another idea: can I assume that some words are reserved, as on github? (you cannot register account with name join, blob or issues)
The routes are the only information the routers get. Putting extra information in the glue code for this benchmark is not allowed.
One year later:
here is smallest working example/proof of concept: https://github.com/Komosa/httpmap (just 2 commits)
I will be glad to know if anyone already implemented my approach:
I have idea to make a router based on hashtable. There is only one problem, how to distinguish parameters and 'static' elements in real paths (eg. in /github.com/julienschmidt/go-http-routing-benchmark/issues/new params are emphasized, rest is static).
There is simple solution, prefix each param with colon in real URL ( /github.com/:julienschmidt/:go-http-routing-benchmark/issues/new ) - it is only a little bit more verbose, but has nice computional properties :)
Do you (or any competiotor?) consider using this as a cheat in competition with other routing implementations?