3 ms·
Interesting approach. I guess there are use cases where the small number of allocs of some of the other routers is enough to cause problems. I'll definitely st
by bgentry 12y ago
Interesting approach. I guess there are use cases where the small number of allocs of some of the other routers is enough to cause problems.
I'll definitely stick to httprouter as my default starting point, though. The params interface is much nicer, and it's pretty damn good with performance and allocation count: https://github.com/julienschmidt/httprouter https://github.com/julienschmidt/httprouter
- bigdubs 12y agoWe're also using httprouter and so far have been pretty happy with it. The lack of middleware isn't really an issue, you can inline the key stuff (Gzip, logging) yourself from other sources.
- misframer 12y agoIt isn't too difficult to add basic middleware support. We actually wrote a tiny framework[0] around httprouter for that to use on our API servers. It works pretty well. [0] https://github.com/VividCortex/siesta https://github.com/VividCortex/siesta