Re: [math-fun] ENIAC and maple : a simple test
Something is not right here. You say the ENIAC has 0.001 MHz clock, so the addition time should be more like 10 ms, and then in 1 s, only 100 numbers are added. Gene ----- Original Message ---- From: Simon Plouffe <simon.plouffe@gmail.com> To: math-fun <math-fun@mailman.xmission.com> Cc: Jean-Paul Delahaye <delahaye@lifl.fr> Sent: Tuesday, July 17, 2007 11:13:05 AM Subject: [math-fun] ENIAC and maple : a simple test Hello, I was reading an article on the ENIAC, that monster could add 100,000 10 digits numbers in 1 second. At the time it was impressive in 1946 of course. I made this simple test, a naive test. I took maple 11, with a 3.0 Ghz PC pentium. ##################################### Digits:=10: som:=0: for i from 1 to 1e99 do: som:=som+1.0/i: if i mod 100000 = 0 then lprint(i,som) fi: od: ##################################### It displays the partial sum of the harmonic series every 100000 terms. this is not optimized, a lazy program. Well, this is the bad news. That loop made on a modern computer with one of the top programs goes at the SAME speed. It takes 1 second to display each step. Are we missing something ? of course, 1) 2 operations are made at each step. 2) the program is NOT optimized. 3) programmed in C, this would be a zillion times better. but still we are 60 years later and we hardly do better !!?? Does maple became a bloat-ware ? ps : the speed of the ENIAC was something like 0.001 Mhz... simon plouffe _______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun ____________________________________________________________________________________ Need a vacation? Get great deals to amazing places on Yahoo! Travel. http://travel.yahoo.com/
I mentioned that number on top of my head : here is the source : http://blogues.cyberpresse.ca/dumais/?p=1000721 (the article is in french), and also wikipedia : http://en.wikipedia.org/wiki/Eniac but, you are right, the mentioned Mhz was for the next computer in that list the CSIRAC (australia) in 1949 had a speed of 0.001MHz. (see the image above the eniac). simon plouffe
In general, Maple is very slow comparing to other interpreters. Python seems to be the best choise at this time. In this particular example, som=0 for i in xrange(1,10000000): som=som+1.0/i if i%100000==0: print som, works hundreds (or thousands) times faster - depending on the architecture. Some of Maple experts (including Carl DeVore and me) know how to make Maple to work faster, but it is not a common knowledge and both Carl and me have chosen to stop providing public Maple support. Alec
I can see that(!), (maple support), your python program is interpreted isn't ? and even there it is hundreds of times faster ? I should post this note on the sci.math.symbolic, this would be a good thing but i don't want to be associated with that 'bodarenko' ? crusade, ...he is right on some aspects of the many critics he posted, it is almost too easy to beat maple on many computations, simon plouffe
I can see that(!), (maple support),
your python program is interpreted isn't ?
Yes it is.
and even there it is hundreds of times faster ?
http://www.python.org Everybody can try (and it's free!)
I should post this note on the sci.math.symbolic, this would be
I stopped posting there a long time ago.
a good thing but i don't want to be associated with that 'bodarenko' ? crusade,
...he is right on some aspects of the many critics he posted,
My opinion is that Vladimir is a very smart guy and a very good tester. However, Maplesoft was not interested in supporting him, as well as other commercial CAS producers - that resulted in a big loss for them (and for those of us who use them) - he could help to eliminate a lot of bugs. One of the main problems with Maple, from my point of view, is that their management is not interested in bug fixing. In particular, thousands of bugs that I reported 4 or 5 years ago are still there.
it is almost too easy to beat maple on many computations,
Absolutely. That was one of the reasons why I stopped using Maple a couple of years ago. Alec
On Wednesday 18 July 2007, Alec Mihailovs wrote:
In this particular example,
som=0 for i in xrange(1,10000000): som=som+1.0/i if i%100000==0: print som,
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.) My machine is an Athlon 64 3200 running in 32-bit mode. It's a little way behind the state of the art, but it's certainly not substantially behind Simon's. -- g
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? Can you provide the precise time estimate? I'll do that for Python (I don't have Maple installed on this computer.) Alec
Well, it isn't hundreds of lines per second. But still it seems to be hundreds time faster than Maple, isn't it?
Can you provide the precise time estimate? I'll do that for Python (I don't have Maple installed on this computer.)
On this particular computer, with Windows Vista and ActiveState Python 2.5.1.1, AMD Athlon 64 X2 5200+,
from time import clock def ti(n): ... t=clock() ... som=0 ... for i in xrange(1,n): ... som=som+1.0/i ... if i%100000==0: ... print som, ... return clock()-t ...
produced the following results (skipping the printed values)
ti(100) 0.00011667999999787071
ti(10000000) 4.3266990400000012
ti(100000000) 42.826358080000006
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. Anyway, it is not that bad. Alec
From: "Alec Mihailovs" <alec@mihailovs.com>
On this particular computer, with Windows Vista and ActiveState Python 2.5.1.1, AMD Athlon 64 X2 5200+,
from time import clock def ti(n): ... t=clock() ... som=0 ... for i in xrange(1,n): ... som=som+1.0/i ... if i%100000==0: ... print som, ... return clock()-t ...
produced the following results (skipping the printed values)
ti(100) 0.00011667999999787071
ti(10000000) 4.3266990400000012
ti(100000000) 42.826358080000006
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. Anyway, it is not that bad.
Just out of curiosity, after I installed Ubuntu 7.04 on that computer, with 500 GB hard drive - enough to split between 2 OS, and with 2 GB of RAM (if that makes a difference), I got the following results with Python 2.5 that comes with Ubuntu (again skipping the printed values),
ti(100) 0
ti(10000000) 4.2800000000000002
ti(100000000) 39.079999999999998
That's generally the same. Amazing thing is that Linux seems to slightly outperform Windows. I guess that's because I used ActiveState Python version in Windows. Later, when I install the standard Python on Windows, I'll check the results there as well. Alec
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
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.
25 is a factor of hundreds by me :) (0.25 hundreds) It may sound like a joke in England, but here, in America - that's exactly what people usually mean by that. You see a commercial: SAVE MILLIONS and then, lower, it says in a small print: well, hundreds...
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.)
Well, that's exactly the results that I got. You may believe them or not. If I compiled Python myself (as I usually do) instead of using one of the most inefficient (ActiveState) implementations, the results would be much better - as I said, hundreds or thousands times better. By the way, that outlines another difference with Maple - with Maple, you get what you get, you can't recompile it, while Python is open source and can be compiled targeted to your (or mine) specific system, with all available optimizations. Alec PS By the way, I am not surprised reading such things as "Really?" or "I could believe a factor of 2 more easily" - I was seeing much worth comments to my posts during last couple of years - Alec
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.)
Well, that's exactly the results that I got. You may believe them or not.
I'm sorry if I wasn't clear: I'm not suggesting that you're lying, or anything like that. It's just puzzling. Perhaps there's some rogue thing slowing my computer down, or something/
If I compiled Python myself (as I usually do) instead of using one of the most inefficient (ActiveState) implementations, the results would be much better - as I said, hundreds or thousands times better.
This, however, I do not believe. Let's say that "hundreds or thousands" means at least 200 in this context; then you're claiming to be able to make Python run 8 times faster by compiling it yourself? Show me the evidence, please, or at least offer some explanation.
PS By the way, I am not surprised reading such things as "Really?" or "I could believe a factor of 2 more easily" - I was seeing much worth comments to my posts during last couple of years - Alec
If you're in the habit of saying "hundreds or thousands" when you mean 25, I'm not greatly surprised either. -- g
participants (4)
-
Alec Mihailovs -
Eugene Salamin -
Gareth McCaughan -
Simon Plouffe