]> Cypherpunks repositories - gostls13.git/commit
syscall: avoid extra syscall on send/recvmsg on Linux
authorJason A. Donenfeld <Jason@zx2c4.com>
Thu, 19 Apr 2018 21:46:52 +0000 (23:46 +0200)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 19 Apr 2018 22:16:24 +0000 (22:16 +0000)
commit68c10286c795e286c3efaa7df6d52d12af446d57
treedb549f58c987a30f011c1f7247eee934b85bf298
parent1c439e6e37c87c9543cb1860c3b8d174658b80ca
syscall: avoid extra syscall on send/recvmsg on Linux

By simply rearranging the logic, we avoid the overhead of a superfluous
call to getsockopt. For, if p is already non empty, there's no point
in having to check if we need to attach dummy payload. This has
performance benefits when using send/recvmsg for high speed
communications.

Change-Id: Id85cff17328ecbf6d09dd52fbeeaa691dbe69b75
Reviewed-on: https://go-review.googlesource.com/108338
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/syscall/syscall_linux.go