On Wednesday 18 July 2007, Alec Mihailovs wrote:
works hundreds (or thousands) times faster - depending on the architecture.
Really?
On my computer, typing the above into the interactive interpreter (and losing the comma on the print statement, because for some reason it isn't flushing its output after a print with no newline) produces lines of output at about 6Hz. (I'm estimating. It might be 4Hz or 10Hz. But it certainly isn't hundreds of lines per second.)
Well, it isn't hundreds of lines per second. But still it seems to be hundreds time faster than Maple, isn't it?
Simon reported approximately one 100k-iteration line printed per second using Maple. I'm getting approximately six per second. You're getting 25 per second. So no, not faster than Maple by a factor of hundreds. (I just did a more quantitative test, and my figure of 6Hz was out by about 0.1%. But that was just good luck.)
Can you provide the precise time estimate? I'll do that for Python (I don't have Maple installed on this computer.)
I don't have Maple at all, so I can't do that. But Simon already did. In a subsequent message:
So, 100000 loop operations were done in about 0.04 seconds each. That's 25 times faster than ENIAC (actually, more than that, because a loop operation is not just an addition) and I can't tell how much it is faster than Maple because I don't have Maple installed.
What Simon reported is that Maple did loop iterations at about the same speed as ENIAC did additions. It sounds as if Python on your machine is about 25 times faster than Maple on his. Faster, for sure, but not "hundreds (or thousands) times faster". It also sounds as if it's about 4 times faster than Python on my machine, which seems odd. (I could believe a factor of 2 more easily.) -- g