[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Pi Day Rematch: Apple II vs. HP-41C
datajerk wrote:
A bit of retro fun: http://jerkwerks.com/?p=378
Happy Pi Day
So for a 1MHz Apple II, we have:
Integer BASIC, digit = 10: 150,410 sec
Mad Apple Forth, digit = 2^16: 1,496 sec
Assembly language, digit = 10: 194 sec
It's a little hard to compare the Forth time with
the others because of the different digit size,
but it appears that Integer BASIC gives up a factor
of approximately 775 relative to assembly language.
Of course, there are implementation differences for
the algorithm, so there's at least another factor
of 2 uncertainty.
I've always used 300x as a rough estimate of the
speed difference between Applesoft and assembly,
and I'd expect Forth to be about in the "Sweet 16"
range of performance, or about 10x-20x slower than
assembly, here partially compensated for by the use
of a more efficient digit size (3.2 digits/2 bytes
rather than 2 digits/2 bytes).
Clearly, any such comparison depends mightily on the
nature of the work being done, since Applesoft's FP
routines are written in assembly language, and as a
program becomes more numerically intensive, it approaches
the speed of the Applesoft FP routines.
But in this case, all computation is integer, and the
time spent in BASIC is practically all interpretive overhead.
-michael
NadaNet 3.1 for Apple II parallel computing!
Home page: http://home.comcast.net/~mjmahon/
"The wastebasket is our most important design
tool--and it's seriously underused."