]> Cypherpunks repositories - gostls13.git/commit
[dev.link] cmd/link: rewrite heap algorithm
authorCherry Zhang <cherryyz@google.com>
Wed, 3 Jun 2020 23:34:29 +0000 (19:34 -0400)
committerCherry Zhang <cherryyz@google.com>
Thu, 4 Jun 2020 19:13:42 +0000 (19:13 +0000)
commit7179e426e2710b56a7b862e089570baa6c7a1a5d
tree4c8dc381029c20056cc3fedbcaca0397b5fe2364
parente4d6bfdbdf6037326633a7826293c848dc0d4228
[dev.link] cmd/link: rewrite heap algorithm

Instead of using container/heap package, implement a simple
specialized heap algorithm for the work queue in the deadcode
pass, to avoid allocations and function pointer calls.

Linking cmd/compile,

name           old time/op    new time/op    delta
Deadcode_GC      59.8ms ± 4%    42.2ms ± 4%  -29.45%  (p=0.008 n=5+5)

name           old alloc/op   new alloc/op   delta
Deadcode_GC      3.53MB ± 0%    2.10MB ± 0%  -40.57%  (p=0.008 n=5+5)

name           old allocs/op  new allocs/op  delta
Deadcode_GC        187k ± 0%        8k ± 0%  -95.48%  (p=0.008 n=5+5)

Change-Id: Ibb21801d5b8e4a7eaf429856702e02720cd1772f
Reviewed-on: https://go-review.googlesource.com/c/go/+/236565
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jeremy Faller <jeremy@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/link/internal/ld/deadcode.go
src/cmd/link/internal/ld/heap.go [new file with mode: 0644]
src/cmd/link/internal/ld/heap_test.go [new file with mode: 0644]