3 ms·
Takes guts to post a project on HN and expose yourself to all sort of criticism. Here's a hopefully constructive critic I hope you can use: * Routing of reques
by AYBABTME 12y ago
Takes guts to post a project on HN and expose yourself to all sort of criticism. Here's a hopefully constructive critic I hope you can use:
* Routing of requests is done in the context of network IO, perhaps disk IO and likely database accesses. The 500 nanoseconds you shave off your request time are likely not worth the trouble you went through, given that a HTTP request sending the bytes of the header will usually amount to a few hundred microseconds, milliseconds with some body. I'd suggest you attack the problem of performance by profiling bottlenecks, to identify parts of your code that have the greatest impact on the request time.
* The benchmark you wrote is not testing your claim (of fast routing/multiplexing), since the benchmark works against a router with no registered routes. When benchmarketing, I'd suggest creating a realistic scenario, a scenario your users are likely to end up with. In your case, this would likely mean a dozen resources, each with about 5 routes, using all verbs.
This blog post is very useful to begin with optimization work in Go: http://blog.golang.org/profiling-go-programs http://blog.golang.org/profiling-go-programs
- andrewchambers 12y agoYeah, that benchmark isn't testing anything realistic. He needs to test against a set of realistic url's each with id tags etc.
- latch 12y agoOn your first point, you're assuming that you know his requirements (or that his requirements weren't just to learn and have fun). I'm a lot more interested in hearing from people who handle 10K req/sec on 4 cores versus those handling 100K req/sec with 1000 cores. Faster code with fewer allocations is always a good thing.
- jerf 12y agoThe way Go makes "publishing to GitHub" and "public distribution" so similar is resulting in a lot of packages up on GitHub where it's not clear to me whether they're just there, or if the author just wants to show it off, or if the author really seriously thinks people should use this, or what. I'm developing an eye twitch in reaction to "A fast, simple, powerful library to do X" showing up on /r/golang. Especially when X is one of the things we have a ton of because they aren't that hard to write in the first place. And especially when no evidence is particularly provided for any of the adjectives, except that the author really hopes they're true.
- squiidz 12y agothanks for the positive comment !
- squiidz 12y agoThanks a lot for the only useful comment! :)