diff options
author | Matt Layher <mdlayher@gmail.com> | 2021-07-21 16:03:34 -0400 |
---|---|---|
committer | Matt Layher <mdlayher@gmail.com> | 2021-08-16 17:40:17 +0000 |
commit | 5c7a460a1c108e5bf7a99817b86ebded7ce81812 (patch) | |
tree | 8228d6e6d4459dba7ff762f935451a3262aca315 /src/cmd/compile/internal/gc/main.go | |
parent | 850768bbc9fd2d74a88233fa1f46791d08d1afc8 (diff) | |
download | go-5c7a460a1c108e5bf7a99817b86ebded7ce81812.tar.gz go-5c7a460a1c108e5bf7a99817b86ebded7ce81812.zip |
syscall: hoist Getsockname out of NetlinkRIB loops
Calling Getsockname once to fetch the Pid field from the *SockaddrNetlink
is necessary, but this data will remain static for the rest of the netlink
socket's lifetime. Moving this call and type assertion outside of the inner
loops will remove a number of unnecessary system calls.
Change-Id: I7e7e81866af1a31fccdaaf7531efd6cc4cbb8926
Reviewed-on: https://go-review.googlesource.com/c/go/+/336369
Run-TryBot: Matt Layher <mdlayher@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Matt Layher <mdlayher@gmail.com>
Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com>
Diffstat (limited to 'src/cmd/compile/internal/gc/main.go')
0 files changed, 0 insertions, 0 deletions