golang speeding up response writing time?
问题 func grabPage(i int, wg *sync.WaitGroup, buf *[]byte) { defer wg.Done() res, err := http.Get("https://en.wikipedia.org/wiki/Immanuel_Kant") if err != nil { log.Fatal(err) } f, err := os.Create(fmt.Sprintf("./data/%d.txt", i)) if err != nil { log.Fatal(err) } _, err = io.CopyBuffer(f, res.Body, *buf) if err != nil { log.Fatal(err) } } func main() { f, _ := os.Create("cpuprofile") pprof.StartCPUProfile(f) defer pprof.StopCPUProfile() runtime.GOMAXPROCS(4) start := time.Now() var wg sync