• Keith Randall's avatar
    runtime: on bigger maps, start iterator at a random bucket. · 55c458e0
    Keith Randall authored
    This change brings the iter/delete pattern down to O(n lgn) from O(n^2).
    
    Fixes #8412.
    
    before:
    BenchmarkMapPop100	   50000	     32498 ns/op
    BenchmarkMapPop1000	     500	   3244851 ns/op
    BenchmarkMapPop10000	       5	 270276855 ns/op
    
    after:
    BenchmarkMapPop100	  100000	     16169 ns/op
    BenchmarkMapPop1000	    5000	    300416 ns/op
    BenchmarkMapPop10000	     300	   5990814 ns/op
    
    LGTM=iant
    R=golang-codereviews, iant, khr
    CC=golang-codereviews
    https://golang.org/cl/141270043
    55c458e0
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...