help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] bug report?


From: nico
Subject: [Help-smalltalk] bug report?
Date: Fri, 21 Nov 2008 14:55:46 +0100

Hi,

I don't know if this really a bug, but trying to do some benchmarks with
a factorial between Smallalk dialects, I got a code dumped:

st> Integer extend [
st> factorial [
st> self = 0 ifTrue: [^1].
st> self > 0 ifTrue: [^self * (self -1) factorial]]]

st> 100 factorial
93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000

st> Time millisecondsToRun: [10000 factorial]
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
26602

st> 10000 factorial
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
"Global garbage collection... done, heap grown"
stdin:28: Aborted
(ip 58)LargePositiveInteger>>#divide:using:
(ip 76)LargePositiveInteger(LargeInteger)>>#//
(ip 28)LargePositiveInteger(Number)>>#retry:coercing:
(ip 40)LargePositiveInteger(LargeInteger)>>#//
(ip 104)LargePositiveInteger(Integer)>>#floorLog:
(ip 44)LargePositiveInteger(Integer)>>#printString:
(ip 6)LargePositiveInteger(Integer)>>#printString
(ip 6)LargePositiveInteger(Object)>>#printNl
(ip 0)<bottom>
Abandon (core dumped)

It looks like the printNl made it crash, which may be normal, I don't
know, that's why I'm asking.

BTW, in Squeak it takes 397 ms on my computer to run 10000 factorial
while it takes more than 26 seconds with gst.

Nico

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée


reply via email to

[Prev in Thread] Current Thread [Next in Thread]