1
0
mirror of https://github.com/golang/go synced 2024-10-05 09:11:21 -06:00
go/src/cmd
Keith Randall 63116de558 runtime: faster version of findfunc
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/2097
Reviewed-by: Russ Cox <rsc@golang.org>
2015-01-07 21:24:21 +00:00
..
5a [dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped 2014-10-28 21:50:16 -04:00
5g runtime: make stack frames fixed size by modifying goproc/deferproc. 2014-12-23 01:08:29 +00:00
5l cmd/ld: support for relocation variants 2015-01-07 20:35:37 +00:00
6a [dev.power64] cmd/5a, cmd/6a, cmd/8a, cmd/9a: make labels function-scoped 2014-10-28 21:50:16 -04:00
6g runtime: make stack frames fixed size by modifying goproc/deferproc. 2014-12-23 01:08:29 +00:00
6l cmd/ld: support for relocation variants 2015-01-07 20:35:37 +00:00
8a runtime: faster aeshash implementation 2014-12-11 05:23:00 +00:00
8g runtime: make stack frames fixed size by modifying goproc/deferproc. 2014-12-23 01:08:29 +00:00
8l cmd/ld: support for relocation variants 2015-01-07 20:35:37 +00:00
9a all: power64 is now ppc64 2014-12-05 19:13:20 -05:00
9g cmd/9g: don't use R13 2015-01-07 20:36:08 +00:00
9l cmd/9g: don't use R13 2015-01-07 20:36:08 +00:00
addr2line cmd/addr2line, cmd/nm: factor object reading into cmd/internal/objfile 2014-08-07 12:33:06 -04:00
api cmd/api: work around Windows rename issue on the builders 2014-12-23 04:55:44 +00:00
cc [dev.cc] all: merge dev.power64 (7667e41f3ced) into dev.cc 2014-11-14 12:10:52 -05:00
cgo cmd/cgo, runtime/cgo: support ppc64 2015-01-07 20:36:27 +00:00
dist cmd/dist: fatal shouldn't print errstr on Plan 9 2014-12-23 10:28:17 +00:00
fix build: adjustments for move from src/pkg to src 2014-09-08 00:06:45 -04:00
gc runtime: remove trailing empty arrays in structs 2015-01-07 16:05:16 +00:00
go cmd/go: buffer output for go usage 2015-01-06 20:31:35 +00:00
gofmt go/format, cmd/gofmt: added missing comments, minor internal cleanup 2014-09-30 12:26:38 -07:00
internal all: power64 is now ppc64 2014-12-05 19:13:20 -05:00
ld runtime: faster version of findfunc 2015-01-07 21:24:21 +00:00
link debug/goobj: move to cmd/internal/goobj 2014-11-16 20:52:45 -05:00
nm build: adjustments for move from src/pkg to src 2014-09-08 00:06:45 -04:00
objdump cmd/objdump: Fix error logging 2014-12-09 00:27:39 +00:00
pack cmd/pack: address go vet reports 2014-12-28 07:08:02 +00:00
pprof cmd/pprof: remove -show_bytes from command line help 2014-12-11 15:23:18 +00:00
yacc cmd/yacc: Prevent index out of range. Fixes #9099. 2014-12-18 16:11:50 +00:00