4 ms·
rorr, you appear to be hellbanned. Here's your comment, since it seemed like a reasonable one: > Now, imagine I created a third benchmark that did something mo
by pifflesnort 14y ago
rorr, you appear to be hellbanned. Here's your comment, since it seemed like a reasonable one:
> Now, imagine I created a third benchmark that did something more complex, like executing a database query and serving the results using the html/template package. There would be a negligible difference in performance across frameworks because routing is not going to be your bottleneck.
If you're performing a DB query on every request, you're doing something wrong. In the real world your app will check Memcached, and if there's a cached response, it will return it. Thus making the framework performance quite important.
- bradrydzewski 14y agoOk, so I added a third benchmark where the handler gets and item from memcache (NOT from a database). Here are the results: PASS Benchmark_Routes 10000 234063 ns/op Benchmark_Pat 10000 233162 ns/op Benchmark_GorillaHandler 5000 265943 ns/op Benchmark_Webgo 5000 348349 ns/op ok github.com/bradrydzewski/routes/bench 10.062s Notice the top 3 frameworks (pat, routes and Gorialla) have almost identical performance results. The point being is that routing and string manipulation are relatively inexpensive when compared to even the most lightweight TCP request, in this case to the memcache server.