]> Cypherpunks repositories - gostls13.git/commit
runtime: simpler and faster GC
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 29 Jul 2014 07:01:02 +0000 (11:01 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 29 Jul 2014 07:01:02 +0000 (11:01 +0400)
commitcd17a717f9f49cffb40fbdef59d1dfac1f9e0cfd
tree9ecec51ca71307c73ac6cdf6522855e0e8b594d8
parent0100afbdcc065ec20631d60cf7621d642f44b9d5
runtime: simpler and faster GC

Implement the design described in:
https://docs.google.com/document/d/1v4Oqa0WwHunqlb8C3ObL_uNQw3DfSY-ztoA-4wWbKcg/pub

Summary of the changes:
GC uses "2-bits per word" pointer type info embed directly into bitmap.
Scanning of stacks/data/heap is unified.
The old spans types go away.
Compiler generates "sparse" 4-bits type info for GC (directly for GC bitmap).
Linker generates "dense" 2-bits type info for data/bss (the same as stacks use).

Summary of results:
-1680 lines of code total (-1000+ in mgc0.c only)
-25% memory consumption
-3-7% binary size
-15% GC pause reduction
-7% run time reduction

LGTM=khr
R=golang-codereviews, rsc, christoph, khr
CC=golang-codereviews, rlh
https://golang.org/cl/106260045
27 files changed:
src/cmd/gc/go.h
src/cmd/gc/plive.c
src/cmd/gc/reflect.c
src/cmd/ld/data.c
src/cmd/ld/decodesym.c
src/cmd/ld/lib.h
src/pkg/reflect/type.go
src/pkg/runtime/chan.goc
src/pkg/runtime/export_test.go
src/pkg/runtime/gc_test.go
src/pkg/runtime/gcinfo_test.go [new file with mode: 0644]
src/pkg/runtime/heapdump.c
src/pkg/runtime/malloc.goc
src/pkg/runtime/malloc.h
src/pkg/runtime/malloc_test.go
src/pkg/runtime/mgc0.c
src/pkg/runtime/mgc0.h
src/pkg/runtime/mheap.c
src/pkg/runtime/mprof.goc
src/pkg/runtime/proc.c
src/pkg/runtime/race.c
src/pkg/runtime/runtime.h
src/pkg/runtime/slice.goc
src/pkg/runtime/stack.c
src/pkg/runtime/type.go
src/pkg/runtime/type.h
src/pkg/runtime/typekind.h