• 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
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...