News for hackers. Stuff that matters.
Re:Zero-cost futures in Rust by jerf on Thursday August 11, 2016 @01:55PM (#12270331)
You may find this makes somewhere more sense to think of it as ~5.3 microseconds per request for fasthttp vs. ~4.8 microseconds for Java vs. ~4.3 for Rust. It's 40 microseconds or so for the standard lib Go. I'm just eyeballing the graph but this should be close enough (dominated by local CPU variances and such). Just as some people point out that "gallons per mile" is a more intuitively useful way of thinking, I think that at this scale "overhead per request" is a better way of thinking about it.

I'm not generally a big fan of measuring the "ping time" response for web servers, but in this case I believe it is justified since we really are trying to establish that this future library is very fast. I fear, based on experience, that some developers well be looking at this and will sit there trying to choose fasthttp vs. rapidoid vs. minihttp based on this one graph, without considering what they really mean. Overhead-per-request I think makes it more clear that for the vast, vast majority of purposes, all of these, including Go and Node, are "way way faster than your code", and unless you know you're building a server where you seriously need to answer an API call at several hundred thousand responses per second, all of these are "fast enough" and the real criteria for choosing should be "everything else".

(One last edit... remember, it's "milli/micro/nano". Micro seems to be forgotten since it seems like many things that we care about fit into nano- or milli-. It's quite a challenge in the web world to get your request out in under a millisecond usually, so .040 milliseconds added as HTTP overhead is rarely the problem.)

Re:Zero-cost futures in Rust by aturon on Thursday August 11, 2016 @02:11PM (#12270450)
Thanks for this comment! I actually totally agree with this perspective, and wish I'd used your suggested scale in the post.
Re:Zero-cost futures in Rust by twotwotwo on Friday August 12, 2016 @02:31PM (#12277755)
In the case of valaya/fasthttp vs. net/http, a bonus thing is that with fasthttp you (currently+AFAIK) lose HTTP/2 support! Needs vary a ton with the app, environment, etc., of course, but it'd be sad to change your server to save 40µs CPU per req. then wind up making users wait extra RTTs--tens to hundreds of ms--as a result.
Re:Zero-cost futures in Rust by im_down_w_otp on Thursday August 11, 2016 @04:08PM (#12271239)
>> "I fear, based on experience, that some developers well be looking at this and will sit there trying to choose..."

Sure, but it's not the responsibility of this blog post to protect bad/lazy engineers from themselves.