| As another commenter mentioned, I learned about Martini midway through writing this. I really like Martini - if it existed a bit earlier, I probably would have just used it and been happy. That being said, there are some differences between the packages. First, Martini has great plugin support because 3rd parties can inject their arbitrary type into handlers. On the other hand, gocraft/web has nested routers and middleware, which are really important for my own projects. This may be temporary, but gocraft/web also has faster performance because it does less reflection, and because it's router is O(log(N)) instead of O(N). (See https://github.com/cypriss/golang-mux-benchmark , especially as you add more routes). Finally, I prefer a more consistent signature to my handlers. Martini optimizes for flexibility. And depending on how much you want to inject into your handlers, your argument list can get really long. Overall, I think Martini is absolutely great and think it's one of the best Go web libs out there. |
Most web apps don't have quite so many routes typically but its not unreasonable and I'm surprised routing is allowed to get so expensive in the other frameworks. Kudos to you, I was psyched about Martini so I'm going to see about fixing that for it at least.
Edit: D'oh. Need coffee. No wonder it looked really bad to me, up to 70ms to do routing is abhorrent. Carry on. :)