]> Cypherpunks repositories - gostls13.git/commit
big: cleanups and performance tuning
authorRobert Griesemer <gri@golang.org>
Sat, 8 May 2010 20:52:36 +0000 (13:52 -0700)
committerRobert Griesemer <gri@golang.org>
Sat, 8 May 2010 20:52:36 +0000 (13:52 -0700)
commit52cc058172fe299b11d01cf5f04500de725bde07
tree0a31ae40aed3869db1b1888ccff3094508de25d8
parent61eb0e71f230d8a7d831786a23efea5b642b94fd
big: cleanups and performance tuning

- removed last argument (n) from all core arithmetic routines;
  instead, use the length of the result

- simplified nat.make implementation and chose a better capacity
  for new values, removed a TODO in the process

Changing the constant e from 1 (old) to 4 (new) improved
pidigits -s -n 10000 by ~9% (on a 3.06GHz Intel Core 2 Duo):

user 0m3.882s (old)
user 0m3.549s (new)

R=rsc
CC=golang-dev
https://golang.org/cl/1133043
src/pkg/big/arith.go
src/pkg/big/arith_386.s
src/pkg/big/arith_amd64.s
src/pkg/big/arith_test.go
src/pkg/big/nat.go