• Russ Cox's avatar
    cmd/gc: emit write barriers · fcb4cabb
    Russ Cox authored
    A write *p = x that needs a write barrier (not all do)
    now turns into runtime.writebarrierptr(p, x)
    or one of the other variants.
    
    The write barrier implementations are trivial.
    The goal here is to emit the calls in the correct places
    and to incur the cost of those function calls in the Go 1.4 cycle.
    
    Performance on the Go 1 benchmark suite below.
    Remember, the goal is to slow things down (and be correct).
    
    We will look into optimizations in separate CLs, as part of
    the process of comparing Go 1.3 against tip in order to make
    sure Go 1.4 runs at least as fast as Go 1.3.
    
    benchmark                          old ns/op      new ns/op      delta
    BenchmarkBinaryTree17              3118336716     3452876110     +10.73%
    BenchmarkFannkuch11                3184497677     3211552284     +0.85%
    BenchmarkFmtFprintfEmpty           89.9           107            +19.02%
    BenchmarkFmtFprintfString          236            287            +21.61%
    BenchmarkFmtFprintfInt             246            278            +13.01%
    BenchmarkFmtFprintfIntInt          395            458            +15.95%
    BenchmarkFmtFprintfPrefixedInt     343            378            +10.20%
    BenchmarkFmtFprintfFloat           477            525            +10.06%
    BenchmarkFmtManyArgs               1446           1707           +18.05%
    BenchmarkGobDecode                 14398047       14685958       +2.00%
    BenchmarkGobEncode                 12557718       12947104       +3.10%
    BenchmarkGzip                      453462345      472413285      +4.18%
    BenchmarkGunzip                    114226016      115127398      +0.79%
    BenchmarkHTTPClientServer          114689         112122         -2.24%
    BenchmarkJSONEncode                24914536       26135942       +4.90%
    BenchmarkJSONDecode                86832877       103620289      +19.33%
    BenchmarkMandelbrot200             4833452        4898780        +1.35%
    BenchmarkGoParse                   4317976        4835474        +11.98%
    BenchmarkRegexpMatchEasy0_32       150            166            +10.67%
    BenchmarkRegexpMatchEasy0_1K       393            402            +2.29%
    BenchmarkRegexpMatchEasy1_32       125            142            +13.60%
    BenchmarkRegexpMatchEasy1_1K       1010           1236           +22.38%
    BenchmarkRegexpMatchMedium_32      232            301            +29.74%
    BenchmarkRegexpMatchMedium_1K      76963          102721         +33.47%
    BenchmarkRegexpMatchHard_32        3833           5463           +42.53%
    BenchmarkRegexpMatchHard_1K        119668         161614         +35.05%
    BenchmarkRevcomp                   763449047      706768534      -7.42%
    BenchmarkTemplate                  124954724      134834549      +7.91%
    BenchmarkTimeParse                 517            511            -1.16%
    BenchmarkTimeFormat                501            514            +2.59%
    
    benchmark                         old MB/s     new MB/s     speedup
    BenchmarkGobDecode                53.31        52.26        0.98x
    BenchmarkGobEncode                61.12        59.28        0.97x
    BenchmarkGzip                     42.79        41.08        0.96x
    BenchmarkGunzip                   169.88       168.55       0.99x
    BenchmarkJSONEncode               77.89        74.25        0.95x
    BenchmarkJSONDecode               22.35        18.73        0.84x
    BenchmarkGoParse                  13.41        11.98        0.89x
    BenchmarkRegexpMatchEasy0_32      213.30       191.72       0.90x
    BenchmarkRegexpMatchEasy0_1K      2603.92      2542.74      0.98x
    BenchmarkRegexpMatchEasy1_32      254.00       224.93       0.89x
    BenchmarkRegexpMatchEasy1_1K      1013.53      827.98       0.82x
    BenchmarkRegexpMatchMedium_32     4.30         3.31         0.77x
    BenchmarkRegexpMatchMedium_1K     13.30        9.97         0.75x
    BenchmarkRegexpMatchHard_32       8.35         5.86         0.70x
    BenchmarkRegexpMatchHard_1K       8.56         6.34         0.74x
    BenchmarkRevcomp                  332.92       359.62       1.08x
    BenchmarkTemplate                 15.53        14.39        0.93x
    
    LGTM=rlh
    R=rlh
    CC=dvyukov, golang-codereviews, iant, khr, r
    https://golang.org/cl/136380043
    fcb4cabb
Name
Last commit
Last update
..
cgo Loading commit data...
debug Loading commit data...
pprof Loading commit data...
race Loading commit data...
Makefile Loading commit data...
alg.go Loading commit data...
append_test.go Loading commit data...
arch_386.go Loading commit data...
arch_386.h Loading commit data...
arch_amd64.go Loading commit data...
arch_amd64.h Loading commit data...
arch_amd64p32.go Loading commit data...
arch_amd64p32.h Loading commit data...
arch_arm.go Loading commit data...
arch_arm.h Loading commit data...
asm_386.s Loading commit data...
asm_amd64.s Loading commit data...
asm_amd64p32.s Loading commit data...
asm_arm.s Loading commit data...
atomic.go Loading commit data...
atomic_386.c Loading commit data...
atomic_amd64x.c Loading commit data...
atomic_arm.go Loading commit data...
cgocall.go Loading commit data...
cgocall.h Loading commit data...
cgocallback.go Loading commit data...
chan.go Loading commit data...
chan.h Loading commit data...
chan_test.go Loading commit data...
closure_test.go Loading commit data...
compiler.go Loading commit data...
complex.go Loading commit data...
complex_test.go Loading commit data...
cpuprof.go Loading commit data...
crash_cgo_test.go Loading commit data...
crash_test.go Loading commit data...
debug.go Loading commit data...
defs.c Loading commit data...
defs1_linux.go Loading commit data...
defs2_linux.go Loading commit data...
defs_android_arm.h Loading commit data...
defs_arm_linux.go Loading commit data...
defs_darwin.go Loading commit data...
defs_darwin_386.h Loading commit data...
defs_darwin_amd64.h Loading commit data...
defs_dragonfly.go Loading commit data...
defs_dragonfly_386.h Loading commit data...
defs_dragonfly_amd64.h Loading commit data...
defs_freebsd.go Loading commit data...
defs_freebsd_386.h Loading commit data...
defs_freebsd_amd64.h Loading commit data...
defs_freebsd_arm.h Loading commit data...
defs_linux.go Loading commit data...
defs_linux_386.h Loading commit data...
defs_linux_amd64.h Loading commit data...
defs_linux_arm.h Loading commit data...
defs_nacl_386.h Loading commit data...
defs_nacl_amd64p32.h Loading commit data...
defs_nacl_arm.h Loading commit data...
defs_netbsd.go Loading commit data...
defs_netbsd_386.go Loading commit data...
defs_netbsd_386.h Loading commit data...
defs_netbsd_amd64.go Loading commit data...
defs_netbsd_amd64.h Loading commit data...
defs_netbsd_arm.go Loading commit data...
defs_netbsd_arm.h Loading commit data...
defs_openbsd.go Loading commit data...
defs_openbsd_386.h Loading commit data...
defs_openbsd_amd64.h Loading commit data...
defs_plan9_386.h Loading commit data...
defs_plan9_amd64.h Loading commit data...
defs_solaris.go Loading commit data...
defs_solaris_amd64.go Loading commit data...
defs_solaris_amd64.h Loading commit data...
defs_windows.go Loading commit data...
defs_windows_386.h Loading commit data...
defs_windows_amd64.h Loading commit data...
env_plan9.go Loading commit data...
env_posix.go Loading commit data...
error.go Loading commit data...
export_futex_test.go Loading commit data...
export_test.go Loading commit data...
extern.go Loading commit data...
float.c Loading commit data...
funcdata.h Loading commit data...
futex_test.go Loading commit data...
gc_test.go Loading commit data...
gcinfo_test.go Loading commit data...
hash_test.go Loading commit data...
hashmap.go Loading commit data...
hashmap_fast.go Loading commit data...
heapdump.c Loading commit data...
iface.go Loading commit data...
iface_test.go Loading commit data...
lfstack.c Loading commit data...
lfstack_test.go Loading commit data...
lock_futex.go Loading commit data...
lock_sema.go Loading commit data...
malloc.c Loading commit data...
malloc.go Loading commit data...
malloc.h Loading commit data...
malloc_test.go Loading commit data...
map_test.go Loading commit data...
mapspeed_test.go Loading commit data...
mcache.c Loading commit data...
mcentral.c Loading commit data...
mem.go Loading commit data...
mem_darwin.c Loading commit data...
mem_dragonfly.c Loading commit data...
mem_freebsd.c Loading commit data...
mem_linux.c Loading commit data...
mem_nacl.c Loading commit data...
mem_netbsd.c Loading commit data...
mem_openbsd.c Loading commit data...
mem_plan9.c Loading commit data...
mem_solaris.c Loading commit data...
mem_windows.c Loading commit data...
memclr_386.s Loading commit data...
memclr_amd64.s Loading commit data...
memclr_arm.s Loading commit data...
memclr_plan9_386.s Loading commit data...
memclr_plan9_amd64.s Loading commit data...
memmove_386.s Loading commit data...
memmove_amd64.s Loading commit data...
memmove_arm.s Loading commit data...
memmove_linux_amd64_test.go Loading commit data...
memmove_nacl_amd64p32.s Loading commit data...
memmove_plan9_386.s Loading commit data...
memmove_plan9_amd64.s Loading commit data...
memmove_test.go Loading commit data...
mfinal_test.go Loading commit data...
mfixalloc.c Loading commit data...
mgc0.c Loading commit data...
mgc0.go Loading commit data...
mgc0.h Loading commit data...
mheap.c Loading commit data...
mknacl.sh Loading commit data...
mprof.go Loading commit data...
msize.c Loading commit data...
netpoll.go Loading commit data...
netpoll_epoll.go Loading commit data...
netpoll_kqueue.go Loading commit data...
netpoll_nacl.go Loading commit data...
netpoll_solaris.c Loading commit data...
netpoll_stub.c Loading commit data...
netpoll_windows.c Loading commit data...
noasm_arm.go Loading commit data...
norace_test.go Loading commit data...
os_android.c Loading commit data...
os_android.h Loading commit data...
os_darwin.c Loading commit data...
os_darwin.go Loading commit data...
os_darwin.h Loading commit data...
os_dragonfly.c Loading commit data...
os_dragonfly.go Loading commit data...
os_dragonfly.h Loading commit data...
os_freebsd.c Loading commit data...
os_freebsd.go Loading commit data...
os_freebsd.h Loading commit data...
os_freebsd_arm.c Loading commit data...
os_linux.c Loading commit data...
os_linux.go Loading commit data...
os_linux.h Loading commit data...
os_linux_386.c Loading commit data...
os_linux_arm.c Loading commit data...
os_nacl.c Loading commit data...
os_nacl.go Loading commit data...
os_nacl.h Loading commit data...
os_nacl_arm.c Loading commit data...
os_netbsd.c Loading commit data...
os_netbsd.go Loading commit data...
os_netbsd.h Loading commit data...
os_netbsd_386.c Loading commit data...
os_netbsd_amd64.c Loading commit data...
os_netbsd_arm.c Loading commit data...
os_openbsd.c Loading commit data...
os_openbsd.go Loading commit data...
os_openbsd.h Loading commit data...
os_plan9.c Loading commit data...
os_plan9.go Loading commit data...
os_plan9.h Loading commit data...
os_plan9_386.c Loading commit data...
os_plan9_amd64.c Loading commit data...
os_solaris.c Loading commit data...
os_solaris.go Loading commit data...
os_solaris.h Loading commit data...
os_windows.c Loading commit data...
os_windows.go Loading commit data...
os_windows.h Loading commit data...
os_windows_386.c Loading commit data...
os_windows_386.go Loading commit data...
os_windows_amd64.c Loading commit data...
os_windows_amd64.go Loading commit data...
panic.c Loading commit data...
panic.go Loading commit data...
parfor.c Loading commit data...
parfor_test.go Loading commit data...
print1.go Loading commit data...
proc.c Loading commit data...
proc.go Loading commit data...
proc_test.go Loading commit data...
race.c Loading commit data...
race.go Loading commit data...
race.h Loading commit data...
race0.go Loading commit data...
race_amd64.s Loading commit data...
rdebug.go Loading commit data...
rt0_android_arm.s Loading commit data...
rt0_darwin_386.s Loading commit data...
rt0_darwin_amd64.s Loading commit data...
rt0_dragonfly_386.s Loading commit data...
rt0_dragonfly_amd64.s Loading commit data...
rt0_freebsd_386.s Loading commit data...
rt0_freebsd_amd64.s Loading commit data...
rt0_freebsd_arm.s Loading commit data...
rt0_linux_386.s Loading commit data...
rt0_linux_amd64.s Loading commit data...
rt0_linux_arm.s Loading commit data...
rt0_nacl_386.s Loading commit data...
rt0_nacl_amd64p32.s Loading commit data...
rt0_nacl_arm.s Loading commit data...
rt0_netbsd_386.s Loading commit data...
rt0_netbsd_amd64.s Loading commit data...
rt0_netbsd_arm.s Loading commit data...
rt0_openbsd_386.s Loading commit data...
rt0_openbsd_amd64.s Loading commit data...
rt0_plan9_386.s Loading commit data...
rt0_plan9_amd64.s Loading commit data...
rt0_solaris_amd64.s Loading commit data...
rt0_windows_386.s Loading commit data...
rt0_windows_amd64.s Loading commit data...
rune.go Loading commit data...
runtime-gdb.py Loading commit data...
runtime.c Loading commit data...
runtime.go Loading commit data...
runtime.h Loading commit data...
runtime_linux_test.go Loading commit data...
runtime_test.go Loading commit data...
runtime_unix_test.go Loading commit data...
select.go Loading commit data...
sema.go Loading commit data...
signal.c Loading commit data...
signal_386.c Loading commit data...
signal_amd64x.c Loading commit data...
signal_android_386.h Loading commit data...
signal_android_arm.h Loading commit data...
signal_arm.c Loading commit data...
signal_darwin_386.h Loading commit data...
signal_darwin_amd64.h Loading commit data...
signal_dragonfly_386.h Loading commit data...
signal_dragonfly_amd64.h Loading commit data...
signal_freebsd_386.h Loading commit data...
signal_freebsd_amd64.h Loading commit data...
signal_freebsd_arm.h Loading commit data...
signal_linux_386.h Loading commit data...
signal_linux_amd64.h Loading commit data...
signal_linux_arm.h Loading commit data...
signal_nacl_386.h Loading commit data...
signal_nacl_amd64p32.h Loading commit data...
signal_nacl_arm.h Loading commit data...
signal_netbsd_386.h Loading commit data...
signal_netbsd_amd64.h Loading commit data...
signal_netbsd_arm.h Loading commit data...
signal_openbsd_386.h Loading commit data...
signal_openbsd_amd64.h Loading commit data...
signal_solaris_amd64.h Loading commit data...
signal_unix.c Loading commit data...
signal_unix.go Loading commit data...
signal_unix.h Loading commit data...
signals_android.h Loading commit data...
signals_darwin.h Loading commit data...
signals_dragonfly.h Loading commit data...
signals_freebsd.h Loading commit data...
signals_linux.h Loading commit data...
signals_nacl.h Loading commit data...
signals_netbsd.h Loading commit data...
signals_openbsd.h Loading commit data...
signals_plan9.h Loading commit data...
signals_solaris.h Loading commit data...
signals_windows.h Loading commit data...
sigpanic_unix.go Loading commit data...
sigqueue.go Loading commit data...
slice.go Loading commit data...
softfloat64.go Loading commit data...
softfloat64_test.go Loading commit data...
softfloat_arm.c Loading commit data...
sqrt.go Loading commit data...
stack.c Loading commit data...
stack.go Loading commit data...
stack.h Loading commit data...
stack_test.go Loading commit data...
string.c Loading commit data...
string.go Loading commit data...
string_test.go Loading commit data...
stubs.go Loading commit data...
symtab.go Loading commit data...
symtab_test.go Loading commit data...
sys_arm.c Loading commit data...
sys_darwin_386.s Loading commit data...
sys_darwin_amd64.s Loading commit data...
sys_dragonfly_386.s Loading commit data...
sys_dragonfly_amd64.s Loading commit data...
sys_freebsd_386.s Loading commit data...
sys_freebsd_amd64.s Loading commit data...
sys_freebsd_arm.s Loading commit data...
sys_linux_386.s Loading commit data...
sys_linux_amd64.s Loading commit data...
sys_linux_arm.s Loading commit data...
sys_nacl_386.s Loading commit data...
sys_nacl_amd64p32.s Loading commit data...
sys_nacl_arm.s Loading commit data...
sys_netbsd_386.s Loading commit data...
sys_netbsd_amd64.s Loading commit data...
sys_netbsd_arm.s Loading commit data...
sys_openbsd_386.s Loading commit data...
sys_openbsd_amd64.s Loading commit data...
sys_plan9_386.s Loading commit data...
sys_plan9_amd64.s Loading commit data...
sys_solaris_amd64.s Loading commit data...
sys_windows_386.s Loading commit data...
sys_windows_amd64.s Loading commit data...
sys_x86.c Loading commit data...
syscall_nacl.h Loading commit data...
syscall_solaris.c Loading commit data...
syscall_solaris.go Loading commit data...
syscall_windows.c Loading commit data...
syscall_windows.go Loading commit data...
syscall_windows_test.go Loading commit data...
thunk.s Loading commit data...
thunk_solaris_amd64.s Loading commit data...
time.go Loading commit data...
tls_arm.s Loading commit data...
traceback.go Loading commit data...
type.h Loading commit data...
typekind.go Loading commit data...
typekind.h Loading commit data...
vdso_linux_amd64.c Loading commit data...
vlop_386.s Loading commit data...
vlop_arm.s Loading commit data...
vlop_arm_test.go Loading commit data...
vlrt.c Loading commit data...
vlrt.go Loading commit data...