everyone says go is fast. rust is fast. but the real hero is usually the linux kernel.
when a client connects, your backend is not the first thing that sees it.
linux receives the syn packet, completes the tcp handshake, and stores the connection in the accept queue. your application is still sleeping.
only when your server calls accept() does linux hand over that already established socket.
accept() does not create a connection. it simply returns the next one waiting.
after that your application reads from the socket, processes the request, writes the response, and waits for the next connection.
go and rust do not have a faster tcp stack. every language uses the same linux networking stack.
their advantage is what happens after accept(). go uses lightweight goroutines while rust async runtimes use epoll to efficiently wait for thousands of sockets.
connection lifecycle: • client sends syn • linux completes the tcp handshake • connection enters the accept queue • accept() returns the socket • application reads and writes data
most connections spend their life doing nothing. the kernel keeps them alive while your runtime sleeps until there is data to read or write.
key points: • linux performs the tcp handshake • accept() returns an already established connection • the accept queue buffers completed connections • go and rust scale because of efficient scheduling, not a different tcp implementation • the kernel does most of the networking work
so yah yah. your backend accepts the socket, but linux already did most of the hard work.