4 ms·
reqwest::get() is even worse than not having a connection pool. It will also reload the full content of system certificate stores on each invocation - since it
by Matthias247 4y ago
reqwest::get() is even worse than not having a connection pool. It will also reload the full content of system certificate stores on each invocation - since it creates a new reqwest client. On some hosts that can take 10-100ms alone.
Always create a client explicitly. And also always add a timeout.
The Go http.Get() function uses a shared global client, so making a request doesn't have high initialization costs, and requests can make sure of a shared connection pool.