julienschmidt / go-http-routing-benchmark

Go HTTP request router and web framework benchmark
BSD 3-Clause "New" or "Revised" License
1.65k stars 238 forks source link

It is fair to adjust URLs? #16

Closed Komosa closed 9 years ago

Komosa commented 9 years ago

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?

julienschmidt commented 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.

Komosa commented 9 years ago

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)

julienschmidt commented 9 years ago

The routes are the only information the routers get. Putting extra information in the glue code for this benchmark is not allowed.

Komosa commented 8 years ago

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: