Dmitriy Vyukov
dc84eca75e
runtime: improve select benchmarks
...
1. Add select on sync channels benchmark.
2. Make channels in BenchmarkSelectNonblock shared.
With GOMAXPROCS=1 it is the same, but with GOMAXPROCS>1
it becomes a more interesting benchmark.
LGTM=khr
R=golang-codereviews, khr
CC=golang-codereviews
https://golang.org/cl/115780043
2014-07-17 21:49:45 +04:00
Dmitriy Vyukov
69257d17fe
runtime: use RunParallel in more benchmarks
...
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/68020043
2014-02-24 20:50:12 +04:00
Dmitriy Vyukov
c3922f0a63
testing: ease writing parallel benchmarks
...
Add b.RunParallel function that captures parallel benchmark boilerplate:
creates worker goroutines, joins worker goroutines, distributes work
among them in an efficient way, auto-tunes grain size.
Fixes #7090 .
R=bradfitz, iant, josharian, tracey.brendan, r, rsc, gobot
CC=golang-codereviews
https://golang.org/cl/57270043
2014-02-17 06:29:56 +04:00
Dmitriy Vyukov
3baceaa151
runtime: add more chan benchmarks
...
Add benchmarks for:
1. non-blocking failing receive (polling of "stop" chan)
2. channel-based semaphore (gate pattern)
3. select-based producer/consumer (pass data through a channel, but also wait on "stop" and "timeout" channels)
LGTM=r
R=golang-codereviews, r
CC=bradfitz, golang-codereviews, iant, khr
https://golang.org/cl/59040043
2014-02-04 09:41:48 +04:00
Dmitriy Vyukov
1b2e435b15
runtime: fix typos in test
...
I don't know what is n, but it exists somewhere there.
LGTM=dave
R=golang-codereviews, dave
CC=golang-codereviews
https://golang.org/cl/58710043
2014-01-31 18:09:53 +04:00
Dmitriy Vyukov
d62379eef5
runtime: more chan tests
...
LGTM=bradfitz
R=golang-codereviews, bradfitz
CC=golang-codereviews
https://golang.org/cl/57390043
2014-01-28 22:45:14 +04:00
Dmitriy Vyukov
1ff1405cc7
runtime: add type algorithms for zero-sized types
...
BenchmarkChanSem old=127ns new=78.6ns
R=golang-dev, bradfitz, sameer, rsc
CC=golang-dev
https://golang.org/cl/5558049
2012-01-20 10:32:55 +04:00
Christopher Wedgwood
6cf61bb5b9
runtime: add test for multiple concurrent channel consumers
...
There was a time (in the past) when this wasn't robust.
R=rsc, dvyukov
CC=golang-dev
https://golang.org/cl/4965058
2011-09-05 07:40:50 -04:00
Gustavo Niemeyer
175849295c
runtime: fix pseudo-randomness on some selects
...
Fixes #2152 .
R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/4888044
2011-08-15 03:51:51 -03:00
Dmitriy Vyukov
d770aadee5
runtime: faster chan creation on Linux/FreeBSD/Plan9
...
The change removes chan finalizer (Lock destructor)
if it is not required on the platform.
benchmark old ns/op new ns/op delta
BenchmarkChanCreation 1132.00 381.00 -66.34%
BenchmarkChanCreation-2 1215.00 243.00 -80.00%
BenchmarkChanCreation-4 1084.00 186.00 -82.84%
BenchmarkChanCreation-8 1415.00 154.00 -89.12%
BenchmarkChanCreation-16 1386.00 144.00 -89.61%
(on 2 x Intel Xeon E5620, 8 HT cores, 2.4 GHz, Linux)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4841041
2011-08-04 08:31:03 -04:00
Dmitriy Vyukov
33ff947cac
runtime: fix compilation of send select cases
...
Fixes #2102 .
R=fullung, rsc
CC=golang-dev
https://golang.org/cl/4825043
2011-07-25 12:25:37 -04:00
Dmitriy Vyukov
90f3cb13fb
runtime: improve performance of sync channels
...
1. SudoG always contains a pointer to the element
(thus no variable size, and less copying).
2. chansend/chanrecv allocate SudoG on the stack.
3. Copying of elements and gorotuine notifications
are moved out of critical sections.
benchmark old ns/op new ns/op delta
BenchmarkSelectUncontended 515.00 514.00 -0.19%
BenchmarkSelectUncontended-2 291.00 281.00 -3.44%
BenchmarkSelectUncontended-4 213.00 189.00 -11.27%
BenchmarkSelectUncontended-8 78.30 79.00 +0.89%
BenchmarkSelectContended 518.00 514.00 -0.77%
BenchmarkSelectContended-2 655.00 631.00 -3.66%
BenchmarkSelectContended-4 1026.00 1051.00 +2.44%
BenchmarkSelectContended-8 2026.00 2128.00 +5.03%
BenchmarkSelectNonblock 175.00 173.00 -1.14%
BenchmarkSelectNonblock-2 85.10 87.70 +3.06%
BenchmarkSelectNonblock-4 60.10 43.30 -27.95%
BenchmarkSelectNonblock-8 37.60 25.50 -32.18%
BenchmarkChanUncontended 109.00 114.00 +4.59%
BenchmarkChanUncontended-2 54.60 57.20 +4.76%
BenchmarkChanUncontended-4 27.40 28.70 +4.74%
BenchmarkChanUncontended-8 14.60 15.10 +3.42%
BenchmarkChanContended 108.00 114.00 +5.56%
BenchmarkChanContended-2 621.00 617.00 -0.64%
BenchmarkChanContended-4 759.00 677.00 -10.80%
BenchmarkChanContended-8 1635.00 1517.00 -7.22%
BenchmarkChanSync 299.00 256.00 -14.38%
BenchmarkChanSync-2 5055.00 4624.00 -8.53%
BenchmarkChanSync-4 4998.00 4680.00 -6.36%
BenchmarkChanSync-8 5019.00 4760.00 -5.16%
BenchmarkChanProdCons0 316.00 274.00 -13.29%
BenchmarkChanProdCons0-2 1280.00 617.00 -51.80%
BenchmarkChanProdCons0-4 2433.00 1332.00 -45.25%
BenchmarkChanProdCons0-8 3651.00 1934.00 -47.03%
BenchmarkChanProdCons10 153.00 152.00 -0.65%
BenchmarkChanProdCons10-2 626.00 581.00 -7.19%
BenchmarkChanProdCons10-4 1440.00 1323.00 -8.12%
BenchmarkChanProdCons10-8 2036.00 2017.00 -0.93%
R=rsc, ken
CC=golang-dev
https://golang.org/cl/4790042
2011-07-20 11:51:25 -04:00