Bignum performance
Chris Double
chris.double at double.co.nz
Sat Sep 14 13:49:54 UTC 2013
Bignum performance in Self seems to be quite slow. Executing 1000
factorial on my laptop gives the following:
[ 1000 factorial ] time
=> 2228
On similar JIT'd languages that support bignums I get subsecond
results. Implementing similar to factorial to use '+' instead of '*' to
ensure that no bignums are created I get:
[ 1000 foo ] time
=> 0
Where 'foo' is a method on 'traits integer':
<= 1 ifTrue: 1 False: [ + predecessor foo ]
Has anyone got ideas on what the performance hit might be caused by?
Chris.
--
http://www.bluishcoder.co.nz
More information about the Self-interest
mailing list