• Dmitry Vyukov's avatar
    runtime: do not scan maps when k/v do not contain pointers · 85e7bee1
    Dmitry Vyukov authored
    Currently we scan maps even if k/v does not contain pointers.
    This is required because overflow buckets are hanging off the main table.
    This change introduces a separate array that contains pointers to all
    overflow buckets and keeps them alive. Buckets themselves are marked
    as containing no pointers and are not scanned by GC (if k/v does not
    contain pointers).
    
    This brings maps in line with slices and chans -- GC does not scan
    their contents if elements do not contain pointers.
    
    Currently scanning of a map[int]int with 2e8 entries (~8GB heap)
    takes ~8 seconds. With this change scanning takes negligible time.
    
    Update #9477.
    
    Change-Id: Id8a04066a53d2f743474cad406afb9f30f00eaae
    Reviewed-on: https://go-review.googlesource.com/3288Reviewed-by: 's avatarKeith Randall <khr@golang.org>
    85e7bee1
Name
Last commit
Last update
..
5a Loading commit data...
5g Loading commit data...
5l Loading commit data...
6a Loading commit data...
6g Loading commit data...
6l Loading commit data...
8a Loading commit data...
8g Loading commit data...
8l Loading commit data...
9a Loading commit data...
9g Loading commit data...
9l Loading commit data...
addr2line Loading commit data...
api Loading commit data...
cc Loading commit data...
cgo Loading commit data...
dist Loading commit data...
fix Loading commit data...
gc Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
ld Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
pprof Loading commit data...
yacc Loading commit data...