4 Commits

Author SHA1 Message Date
Josh Bleecher Snyder
8ad0a7e785 net: pass around pointers to SockaddrInetN
...instead of the structs themselves.
Escape analysis can handle this,
and it'll avoid a bunch of large struct copies.

Change-Id: Ia9c6064ed32a4c26d5a96dae2ed7d7ece6d38704
Reviewed-on: https://go-review.googlesource.com/c/go/+/361264
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-04 21:52:36 +00:00
Josh Bleecher Snyder
37634eeff9 net: remove the alloc from ReadMsgUDPAddrPort
name                          old time/op    new time/op    delta
ReadWriteMsgUDPAddrPort-8       4.95µs ± 5%    4.55µs ± 1%    -7.96%  (p=0.016 n=5+4)

name                          old alloc/op   new alloc/op   delta
ReadWriteMsgUDPAddrPort-8        32.0B ± 0%      0.0B       -100.00%  (p=0.008 n=5+5)

name                          old allocs/op  new allocs/op  delta
ReadWriteMsgUDPAddrPort-8         1.00 ± 0%      0.00       -100.00%  (p=0.008 n=5+5)

Change-Id: Ib968c6f2968926ec9a364dd52063cd0d7c29b10c
Reviewed-on: https://go-review.googlesource.com/c/go/+/360862
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-04 21:52:06 +00:00
Josh Bleecher Snyder
bfd74fd422 net: remove the alloc from WriteMsgUDPAddrPort
name                       old time/op    new time/op    delta
ReadWriteMsgUDPAddrPort-8    5.12µs ± 8%    4.59µs ± 3%  -10.19%  (p=0.000 n=10+9)

name                       old alloc/op   new alloc/op   delta
ReadWriteMsgUDPAddrPort-8     64.0B ± 0%     32.0B ± 0%  -50.00%  (p=0.000 n=10+10)

name                       old allocs/op  new allocs/op  delta
ReadWriteMsgUDPAddrPort-8      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.000 n=10+10)

Change-Id: Idf540b2f9f8035660305a0ab1cfc3e162569db63
Reviewed-on: https://go-review.googlesource.com/c/go/+/361257
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2021-11-04 21:50:21 +00:00
Josh Bleecher Snyder
d3f5dd5781 syscall: migrate new UDP send/recv API to internal/syscall/unix
CL 331490 and friends added new API to package syscall.
This was a mistake that we need to fix before Go 1.18 is released.

Change-Id: I697c9a4fa649d564822f585dc163df5ab9e5ae08
Reviewed-on: https://go-review.googlesource.com/c/go/+/361216
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2021-11-03 21:45:33 +00:00