]> Cypherpunks repositories - gostls13.git/commit
net: remove allocation from UDPConn.WriteTo
authorJosh Bleecher Snyder <josharian@gmail.com>
Wed, 26 May 2021 19:55:16 +0000 (12:55 -0700)
committerDamien Neil <dneil@google.com>
Mon, 16 Aug 2021 23:54:32 +0000 (23:54 +0000)
commitd9349175ad13ab228d3224c4bff8e3e1b2936b42
treeb451b8f1f7a1821aeba031ccd58a0bf00eb10a89
parent8ff16c19909e5aecf51c6b993cba36ea51791f34
net: remove allocation from UDPConn.WriteTo

Duplicate some code to avoid an interface.

name                  old time/op    new time/op    delta
WriteToReadFromUDP-8    6.38µs ±20%    5.59µs ±10%  -12.38%  (p=0.001 n=10+9)

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

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

Windows is temporarily stubbed out.

Updates #43451

Change-Id: Ied15ff92268c652cf445836e0446025eaeb60cc9
Reviewed-on: https://go-review.googlesource.com/c/go/+/331489
Trust: Josh Bleecher Snyder <josharian@gmail.com>
Trust: Damien Neil <dneil@google.com>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
api/next.txt
src/internal/poll/fd_unix.go
src/internal/poll/fd_windows.go
src/net/fd_posix.go
src/net/ipsock_posix.go
src/net/net_fake.go
src/net/udpsock_posix.go
src/syscall/net_js.go
src/syscall/syscall_unix.go