aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_windows_test.go
diff options
context:
space:
mode:
authorAlex Brainman <alex.brainman@gmail.com>2016-03-30 16:33:52 +1100
committerAlex Brainman <alex.brainman@gmail.com>2016-04-04 10:05:05 +0000
commit1f5b1b2b66ee530af8d86c190c74f49a2809ee92 (patch)
tree806859dd0db522ce7de71783fbe91a24460ad909 /src/runtime/export_windows_test.go
parent02adfa0b3d6dd46dc69709df7f39a1c947bec867 (diff)
downloadgo-1f5b1b2b66ee530af8d86c190c74f49a2809ee92.tar.gz
go-1f5b1b2b66ee530af8d86c190c74f49a2809ee92.zip
runtime: change osyield to use Windows SwitchToThread
It appears that windows osyield is just 15ms sleep on my computer (see benchmarks below). Replace NtWaitForSingleObject in osyield with SwitchToThread (as suggested by Dmitry). Also add issue #14790 related benchmarks, so we can track perfomance changes in CL 20834 and CL 20835 and beyond. Update #14790 benchmark old ns/op new ns/op delta BenchmarkChanToSyscallPing1ms 1953200 1953000 -0.01% BenchmarkChanToSyscallPing15ms 31562904 31248400 -1.00% BenchmarkSyscallToSyscallPing1ms 5247 4202 -19.92% BenchmarkSyscallToSyscallPing15ms 5260 4374 -16.84% BenchmarkChanToChanPing1ms 474 494 +4.22% BenchmarkChanToChanPing15ms 468 489 +4.49% BenchmarkOsYield1ms 980018 75.5 -99.99% BenchmarkOsYield15ms 15625200 75.8 -100.00% Change-Id: I1b4cc7caca784e2548ee3c846ca07ef152ebedce Reviewed-on: https://go-review.googlesource.com/21294 Run-TryBot: Alex Brainman <alex.brainman@gmail.com> Reviewed-by: Dmitry Vyukov <dvyukov@google.com> Run-TryBot: Dmitry Vyukov <dvyukov@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/export_windows_test.go')
-rw-r--r--src/runtime/export_windows_test.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/runtime/export_windows_test.go b/src/runtime/export_windows_test.go
index dbca8d636e..66c103709c 100644
--- a/src/runtime/export_windows_test.go
+++ b/src/runtime/export_windows_test.go
@@ -9,6 +9,7 @@ package runtime
import "unsafe"
var TestingWER = &testingWER
+var OsYield = osyield
func NumberOfProcessors() int32 {
var info systeminfo