• Dmitriy Vyukov's avatar
    runtime: improve performance of sync channels · 90f3cb13
    Dmitriy Vyukov authored
    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
    90f3cb13
Name
Last commit
Last update
..
archive Loading commit data...
asn1 Loading commit data...
big Loading commit data...
bufio Loading commit data...
bytes Loading commit data...
cmath Loading commit data...
compress Loading commit data...
container Loading commit data...
crypto Loading commit data...
csv Loading commit data...
debug Loading commit data...
ebnf Loading commit data...
encoding Loading commit data...
exec Loading commit data...
exp Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
gob Loading commit data...
hash Loading commit data...
html Loading commit data...
http Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
io Loading commit data...
json Loading commit data...
log Loading commit data...
mail Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
netchan Loading commit data...
os Loading commit data...
patch Loading commit data...
path Loading commit data...
rand Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
rpc Loading commit data...
runtime Loading commit data...
scanner Loading commit data...
smtp Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
syslog Loading commit data...
tabwriter Loading commit data...
template Loading commit data...
testing Loading commit data...
time Loading commit data...
try Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
utf16 Loading commit data...
utf8 Loading commit data...
websocket Loading commit data...
xml Loading commit data...
Makefile Loading commit data...
deps.bash Loading commit data...