• Keith Randall's avatar
    runtime: faster version of findfunc · 63116de5
    Keith Randall authored
    Use a lookup table to find the function which contains a pc.  It is
    faster than the old binary search.  findfunc is used primarily for
    stack copying and garbage collection.
    
    benchmark              old ns/op     new ns/op     delta
    BenchmarkStackCopy     294746596     255400980     -13.35%
    
    (findfunc is one of several tasks done by stack copy, the findfunc
    time itself is about 2.5x faster.)
    
    The lookup table is built at link time.  The table grows the binary
    size by about 0.5% of the text segment.
    
    We impose a lower limit of 16 bytes on any function, which should not
    have much of an impact.  (The real constraint required is <=256
    functions in every 4096 bytes, but 16 bytes/function is easier to
    implement.)
    
    Change-Id: Ic315b7a2c83e1f7203cd2a50e5d21a822e18fdca
    Reviewed-on: https://go-review.googlesource.com/2097Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    63116de5
Name
Last commit
Last update
..
data.c Loading commit data...
decodesym.c Loading commit data...
doc.go Loading commit data...
dwarf.c Loading commit data...
dwarf.h Loading commit data...
dwarf_defs.h Loading commit data...
elf.c Loading commit data...
elf.h Loading commit data...
go.c Loading commit data...
ldelf.c Loading commit data...
ldmacho.c Loading commit data...
ldpe.c Loading commit data...
lib.c Loading commit data...
lib.h Loading commit data...
macho.c Loading commit data...
macho.h Loading commit data...
pcln.c Loading commit data...
pe.c Loading commit data...
pe.h Loading commit data...
pobj.c Loading commit data...
symtab.c Loading commit data...
textflag.h Loading commit data...