I was try using net.Buffers for writev. But I meet a unexptected allocs in 
benchmark.  

https://go.dev/play/p/SHpxSYbP1I5

when I run the benchmark:

goos: linux
goarch: amd64
pkg: writev
BenchmarkWrite_Writev/escape-4               272901          4198 ns/op     
     24 B/op           1 allocs/op
BenchmarkWrite_Writev/noescape-4             273751          4267 ns/op     
      0 B/op           0 allocs/op
PASS
ok      writev    3.410s

Is the noescape safe ? 
Is there a better way to avoid the alloc/escape ?
-
Best regards
Lee

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/04b23c46-b992-444d-b80e-cb02eaf06a43n%40googlegroups.com.

Reply via email to