Closed dgrr closed 6 years ago
All your benchmarks have ~ 70% deviation. Additionally, why include I/O if you're comparing just Time?
Try running it with less noise, or do a -count=N
microbenchmark and compress the results with https://godoc.org/golang.org/x/perf/cmd/benchstat
No, this is the result of wrk not the server. There are no such I/O operations.
I think the changes that affect the speed the most are https://github.com/erikdubbelboer/fasthttp/commit/68b32a0d51e814d5ba73c198ffe0f239ffa53573 and https://github.com/erikdubbelboer/fasthttp/commit/477f2120b4121afe5c032aeec5d3cadd43090f7d which are bug fixes that are required.
I don't think a difference between 3095472 and 2674872 requests per second is a big deal. Once you start doing something meaningful in your requests it's going to be much slower anyways. The most important thing of fasthttp is that it has way less heap allocations than net/http as this affects more than only speed.
Also CoarseTime introduced many bugs: https://github.com/valyala/fasthttp/issues/260, https://github.com/valyala/fasthttp/issues/311, https://github.com/valyala/fasthttp/issues/261 and https://github.com/valyala/fasthttp/issues/271 for example.
wrk benchmark is I/O. And erik's argument trumps it all tbh.
Oh, you are right! I did not see the bugs that CoarseTime causes.
Hello contributors.
A few days ago I decided to follow developing a few enhancements for fasthttp (as http2 or cookiejar for clients). This is why I started making some benchmarks with wrk comparing valyala's fasthttp and the erik's fork. The best results that I got are the following:
Vayala's fasthttp:
Erik's fasthttp:
This benchmark have been done in a DualCore (I know it is not the best computer to bench this).
After seeing the result I searched the differences between both libraries. One of this is the CoarseTimeNow function.
As Erik specified here this function does not provide a real speedup. These are the results of implementing CoarseTimeNow in Erik's fork:
As you can see there are a little enhancement. Searching about this function I remember that I reply to another user that enhanced this function (can see here) Implementing bronze1man's code I got the following result:
As you can see there are an enhancement that can mark the difference between the first benchmark and the last one.