]> Cypherpunks repositories - gostls13.git/commit
runtime: change osyield to use Windows SwitchToThread
authorAlex Brainman <alex.brainman@gmail.com>
Wed, 30 Mar 2016 05:33:52 +0000 (16:33 +1100)
committerAlex Brainman <alex.brainman@gmail.com>
Mon, 4 Apr 2016 10:05:05 +0000 (10:05 +0000)
commit1f5b1b2b66ee530af8d86c190c74f49a2809ee92
tree806859dd0db522ce7de71783fbe91a24460ad909
parent02adfa0b3d6dd46dc69709df7f39a1c947bec867
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>
src/runtime/export_windows_test.go
src/runtime/os1_windows.go
src/runtime/sys_windows_386.s
src/runtime/sys_windows_amd64.s
src/runtime/syscall_windows_test.go