]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/objfile: reuse tabwriter across symbols when disassembling
authorJosh Bleecher Snyder <josharian@gmail.com>
Fri, 13 Apr 2018 22:37:37 +0000 (15:37 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 13 Apr 2018 23:54:05 +0000 (23:54 +0000)
commit9137edc986629c18760c4633166b29b556e64567
tree641700909f1c6ad878dff56189439a2e00254c1f
parent983fca55c0c43ef8cc663e3c0770d62032eac495
cmd/internal/objfile: reuse tabwriter across symbols when disassembling

Since the tabwriter is flushed at every symbol,
it can be re-used with no impact on the output.

This cuts allocated space when objdump-ing
the compiler by almost 40%,
and enables further upcoming improvements.

It also speeds up objdump.

name            old time/op       new time/op       delta
ObjdumpCompile        9.22s ± 3%        8.77s ± 3%   -4.79%  (p=0.000 n=10+9)

Change-Id: Ief114d6c2680a4e762b5f439d3ca8dc7a89b9b27
Reviewed-on: https://go-review.googlesource.com/106978
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/internal/objfile/disasm.go