I'm trying to speed up api requests in go. They go slow using the standard "net/http". Does anyone know a method to speed up api requests in go? I'm trying to reach 10k requests per second for a different program.
Example code:
func main() {
counter := 0
for {
resp, err := http.Get("http://google.com")
if err != nil {
log.Fatal(err)
}
if resp.StatusCode == 200 {
counter++
fmt.Print(counter, "\n")
}
}
}
Output (with one sec in between):
1
2
3
4
..