Re:Bone – Lightning Fast HTTP Multiplexer in Go
by latch on Friday December 12, 2014 @02:08AM
(#8738886)
On 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.
Re:Bone – Lightning Fast HTTP Multiplexer in Go
by jerf on Friday December 12, 2014 @08:38AM
(#8739890)
The 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.
Re:Bone – Lightning Fast HTTP Multiplexer in Go
by squiidz on Sunday December 14, 2014 @12:11AM
(#8747508)
thanks for the positive comment !
Re:Bone – Lightning Fast HTTP Multiplexer in Go
by andrewchambers on Friday December 12, 2014 @01:19AM
(#8738810)
Yeah, that benchmark isn't testing anything realistic. He needs to test against a set of realistic url's each with id tags etc.
* 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