]> Cypherpunks.ru repositories - gostls13.git/commit
test/fibo: a stand-alone bignum/allocation benchmark and test
authorRobert Griesemer <gri@golang.org>
Mon, 8 Dec 2014 19:20:41 +0000 (11:20 -0800)
committerRobert Griesemer <gri@golang.org>
Mon, 8 Dec 2014 20:57:31 +0000 (20:57 +0000)
commit8d5fe682b0900a29f524910770e547f14023afcd
tree39b1d0af5f939838898c42d279acbe535e5cbb8c
parent8eb8b40a4965c0bd5f96dfdfc5b037925f630c2d
test/fibo: a stand-alone bignum/allocation benchmark and test

Usage:
fibo <n>        compute fibonacci(n), n must be >= 0
fibo -bench     benchmark fibonacci computation (takes about 1 min)

Additional flags:
-half           add values using two half-digit additions
-opt            optimize memory allocation through reuse
-short          only print the first 10 digits of very large fibonacci numbers

This change was reviewed in detail as https://codereview.appspot.com/168480043 .

Change-Id: I7c86d49c5508532ea6206d00f424cf2117d2fe41
Reviewed-on: https://go-review.googlesource.com/1211
Reviewed-by: Russ Cox <rsc@golang.org>
test/fibo.go [new file with mode: 0644]