Closed aggroot closed 1 year ago
I can't reproduce this. Which version of Go are you using? Which OS are you on? How do you start/compile the programs?
If you are on Windows and you have a virus scanner it's probably causing this.
go version:
go version go1.20.4 linux/amd64
OS: WSL2 on windows with the browser opened on windows and server running in WSL
start command: a simple go run
It could be my setup, but i'm thinking that my setup should affect also other frameworks or net/http, but it doesn't. I tried with gin also which uses a different router than net/http... and the results are similar with net/http
Do you have any virus scanner? My guess is that your virus scanner recognizes net/http early and allows it quickly while fasthttp takes a bit longer. Try disabling your virus scanner. fasthttp just uses the normal Go networking library, just like net/http does. So I'm afraid there is nothing we could do about this.
Hello, I m trying to build a web server using fiber and the initial connection between browser and server (the tcp handshake) seems slow compared with net/http and other frameworks: Here is some simple code that I m using to test and compare:
Below are the results (also verified with fasthttp):
fiber:
fasthttp:
net/http