diff options
| author | Dmitriy Vyukov <dvyukov@google.com> | 2013-08-06 14:40:10 +0400 |
|---|---|---|
| committer | Dmitriy Vyukov <dvyukov@google.com> | 2013-08-06 14:40:10 +0400 |
| commit | 04b1cfa94635f18462b8a076cebacc5e08d92631 (patch) | |
| tree | f1ec37172bfb020b79068f35ef028ac4a62d39a7 /src/pkg/runtime | |
| parent | 9c0500b466196388ab40e03c94759066bb1c7fe6 (diff) | |
| download | go-04b1cfa94635f18462b8a076cebacc5e08d92631.tar.xz | |
net: reduce number of memory allocations during IO operations
Embed all data necessary for read/write operations directly into netFD.
benchmark old ns/op new ns/op delta
BenchmarkTCP4Persistent 27669 23341 -15.64%
BenchmarkTCP4Persistent-2 18173 12558 -30.90%
BenchmarkTCP4Persistent-4 10390 7319 -29.56%
This change will intentionally break all builders to see
how many allocations they do per read/write.
This will be fixed soon afterwards.
R=golang-dev, alex.brainman
CC=golang-dev
https://golang.org/cl/12413043
Diffstat (limited to 'src/pkg/runtime')
| -rw-r--r-- | src/pkg/runtime/netpoll_windows.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/runtime/netpoll_windows.c b/src/pkg/runtime/netpoll_windows.c index e2153c540e..7a95380a33 100644 --- a/src/pkg/runtime/netpoll_windows.c +++ b/src/pkg/runtime/netpoll_windows.c @@ -16,9 +16,9 @@ extern void *runtime·GetQueuedCompletionStatus; #define INVALID_HANDLE_VALUE ((uintptr)-1) -// net_anOp must be the same as beginning of net.anOp. Keep these in sync. -typedef struct net_anOp net_anOp; -struct net_anOp +// net_op must be the same as beginning of net.operation. Keep these in sync. +typedef struct net_op net_op; +struct net_op { // used by windows Overlapped o; @@ -66,7 +66,7 @@ runtime·netpoll(bool block) { uint32 wait, qty, key; int32 mode, errno; - net_anOp *o; + net_op *o; G *gp; if(iocphandle == INVALID_HANDLE_VALUE) |
