diff options
author | Russ Cox <rsc@golang.org> | 2014-08-06 15:46:33 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2014-08-06 15:46:33 -0400 |
commit | e1c6ccb686e8592f97e5302dda03f73a914de75f (patch) | |
tree | 51972d24c51bebd426d7e17b69bc36183c55d6be /lib | |
parent | 69ff935d27eaaf430fa3041fd1a0ef6628d5b991 (diff) | |
download | go-e1c6ccb686e8592f97e5302dda03f73a914de75f.tar.gz |
cmd/gc: make liveness ~10x faster
1) The arrayindexof lookup function is O(n). Replace with O(1) lookups.
2) The checkptxt function is O(n?) and is purely for debugging.
Only run when the debugging flags are turned on.
3) Iterating over sparse bitmaps can be done faster word by word.
Introduce and use bvnext for that.
Run times before and after, on my 2.5 GHz Core i5 MacBook Pro.
x.go 9.48 0.84 issue 8259
x100.go 0.01 0.01 issue 8354
x1000.go 0.10 0.10
x2000.go 0.62 0.19
x3000.go 1.33 0.34
x4000.go 2.29 0.49
x5000.go 3.89 0.67
x6000.go 5.00 0.90
x7000.go 6.70 1.13
x8000.go 9.44 1.38
x9000.go 11.23 1.87
x10000.go 13.78 2.09
Fixes issue 8259.
Fixes issue 8354.
LGTM=iant, r
R=golang-codereviews, iant, r
CC=golang-codereviews
https://codereview.appspot.com/125720043
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions