gocraft / web

Go Router + Middleware. Your Contexts.
MIT License
1.51k stars 124 forks source link

Info: similar approach at GOV.UK. the routes are key! #2

Closed patrickToca closed 10 years ago

patrickToca commented 10 years ago

You route as a TREE is an excellent idea. The benchmark too. This article should interest you: "https://gdstechnology.blog.gov.uk/2013/12/05/building-a-new-router-for-gov-uk/", similar approach, using a TRIE instead (see code on github). If your tree is not to remained always balanced, a TREAP could enhance your solution further (see example of implementation here: stathat and https://github.com/zond/treap). I have no time to contribute to gocraft/web now but will when time available.

cypriss commented 10 years ago

Looks like our routing algorithm is identical. Maybe I should rename the struct trie instead of tree?