Descriptionruntime: reduce gc latency
Replace 1µs/100µs sleeps with yields. These sleeps take up to 10ms
on some systems, and usually take 1ms on most systems. When we yield we
are usually rescheduled much faster than that.
Results on 8-way Linux with tickless kernel:
Machine is:
$ uname -a
Linux 6d0b706a-0ddb-6734-844b-882660956eb8 3.8.6-joyent-debian-6-opt #1 SMP Wed Apr 10 22:00:18 UTC 2013 x86_64 GNU/Linux
$
$ lscpu
Architecture: x86_64
CPU op-mode(s): 64-bit
CPU(s): 8
Thread(s) per core: 1
Core(s) per socket: 1
CPU socket(s): 8
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 44
Stepping: 2
CPU MHz: 2400.024
L1d cache: 32K
L1i cache: 32K
L2 cache: 4096K
$
$ zgrep CONFIG_NO_HZ /proc/config.gz
CONFIG_NO_HZ=y
$ zgrep HIGH_RES_TIMERS /proc/config.gz
CONFIG_HIGH_RES_TIMERS=y
Before (on revision b2ebbbcfc615):
$ ./runtime.test -test.v -test.cpu=1,2,4,8,16 -test.run TestStackGrowth$ runtime
=== RUN TestStackGrowth
--- PASS: TestStackGrowth (2.23 seconds)
=== RUN TestStackGrowth-2
--- PASS: TestStackGrowth-2 (2.66 seconds)
=== RUN TestStackGrowth-4
--- PASS: TestStackGrowth-4 (3.33 seconds)
=== RUN TestStackGrowth-8
--- PASS: TestStackGrowth-8 (4.02 seconds)
=== RUN TestStackGrowth-16
--- PASS: TestStackGrowth-16 (3.82 seconds)
PASS
With this CL:
$ ./runtime.test -test.v -test.cpu=1,2,4,8,16 -test.run TestStackGrowth$ runtime
=== RUN TestStackGrowth
--- PASS: TestStackGrowth (2.27 seconds)
=== RUN TestStackGrowth-2
--- PASS: TestStackGrowth-2 (1.94 seconds)
=== RUN TestStackGrowth-4
--- PASS: TestStackGrowth-4 (2.94 seconds)
=== RUN TestStackGrowth-8
--- PASS: TestStackGrowth-8 (3.73 seconds)
=== RUN TestStackGrowth-16
--- PASS: TestStackGrowth-16 (3.47 seconds)
PASS
Results on 2-way Solaris with 100Hz clock tick:
Machine:
; psrinfo -vp
The physical processor has 2 virtual processors (0-1)
x86 (GenuineIntel 6F2 family 6 model 15 step 2 clock 1829 MHz)
Intel(r) Core(tm)2 CPU T5600 @ 1.83GHz
Before:
; runtime.test -test.v -test.cpu=1,2,4,8 -test.run TestStackGrowth$ runtime
=== RUN TestStackGrowth
--- PASS: TestStackGrowth (2.13 seconds)
=== RUN TestStackGrowth-2
--- PASS: TestStackGrowth-2 (32.48 seconds)
=== RUN TestStackGrowth-4
--- PASS: TestStackGrowth-4 (32.36 seconds)
=== RUN TestStackGrowth-8
--- PASS: TestStackGrowth-8 (30.10 seconds)
PASS
After:
; runtime.test -test.v -test.cpu=1,2,4,8 -test.run TestStackGrowth$ runtime
=== RUN TestStackGrowth
--- PASS: TestStackGrowth (2.08 seconds)
=== RUN TestStackGrowth-2
--- PASS: TestStackGrowth-2 (2.02 seconds)
=== RUN TestStackGrowth-4
--- PASS: TestStackGrowth-4 (1.97 seconds)
=== RUN TestStackGrowth-8
--- PASS: TestStackGrowth-8 (2.00 seconds)
PASS
Results on 24-way Solaris with 1kHz clock tick:
Machine:
$ psrinfo -pv
The physical processor has 6 cores and 12 virtual processors (1 3 5 7 9 11 13 15 17 19 21 23)
The core has 2 virtual processors (1 13)
The core has 2 virtual processors (3 15)
The core has 2 virtual processors (5 17)
The core has 2 virtual processors (7 19)
The core has 2 virtual processors (9 21)
The core has 2 virtual processors (11 23)
x86 (GenuineIntel 206C2 family 6 model 44 step 2 clock 2400 MHz)
Intel(r) Xeon(r) CPU E5645 @ 2.40GHz
The physical processor has 6 cores and 12 virtual processors (0 2 4 6 8 10 12 14 16 18 20 22)
The core has 2 virtual processors (0 12)
The core has 2 virtual processors (2 14)
The core has 2 virtual processors (4 16)
The core has 2 virtual processors (6 18)
The core has 2 virtual processors (8 20)
The core has 2 virtual processors (10 22)
x86 (GenuineIntel 206C2 family 6 model 44 step 2 clock 2400 MHz)
Intel(r) Xeon(r) CPU E5645 @ 2.40GHz
Before:
$ ./runtime.test -test.v -test.cpu=1,2,4,8,12,16,24,32,48 -test.run TestStackGrowth$ runtime
=== RUN TestStackGrowth
--- PASS: TestStackGrowth (2.61 seconds)
=== RUN TestStackGrowth-2
--- PASS: TestStackGrowth-2 (6.03 seconds)
=== RUN TestStackGrowth-4
--- PASS: TestStackGrowth-4 (7.94 seconds)
=== RUN TestStackGrowth-8
--- PASS: TestStackGrowth-8 (8.31 seconds)
=== RUN TestStackGrowth-12
--- PASS: TestStackGrowth-12 (8.39 seconds)
=== RUN TestStackGrowth-16
--- PASS: TestStackGrowth-16 (8.37 seconds)
=== RUN TestStackGrowth-24
--- PASS: TestStackGrowth-24 (8.45 seconds)
=== RUN TestStackGrowth-32
--- PASS: TestStackGrowth-32 (8.48 seconds)
=== RUN TestStackGrowth-48
--- PASS: TestStackGrowth-48 (8.54 seconds)
PASS
After:
=== RUN TestStackGrowth
--- PASS: TestStackGrowth (2.67 seconds)
=== RUN TestStackGrowth-2
--- PASS: TestStackGrowth-2 (2.38 seconds)
=== RUN TestStackGrowth-4
--- PASS: TestStackGrowth-4 (2.71 seconds)
=== RUN TestStackGrowth-8
--- PASS: TestStackGrowth-8 (3.13 seconds)
=== RUN TestStackGrowth-12
--- PASS: TestStackGrowth-12 (3.06 seconds)
=== RUN TestStackGrowth-16
--- PASS: TestStackGrowth-16 (3.08 seconds)
=== RUN TestStackGrowth-24
--- PASS: TestStackGrowth-24 (2.95 seconds)
=== RUN TestStackGrowth-32
--- PASS: TestStackGrowth-32 (2.98 seconds)
=== RUN TestStackGrowth-48
--- PASS: TestStackGrowth-48 (3.09 seconds)
Fixes issue 7763
Patch Set 1 #Patch Set 2 : diff -r b3405f9c2e32 https://code.google.com/p/go #Patch Set 3 : diff -r b3405f9c2e32 https://code.google.com/p/go #
MessagesTotal messages: 5
|