On 12/01/2007, at 3:05 AM, zentara wrote:
Hi, this sort of interested me too, so I made a couple of programs
that you can run yourself, to test.
I have a 2Ghz Athlon, and 1 Gig ram, so your results may
vary, and the scripts may need to be modified.
The idea is to make an array of 50,000,000 doubles, and
cycle thru them 10 times to increment them.
The C program and the Perl-PDL program were very close
on my system, at about 10 secs, and 480 Megs of ram used.
--- Start ancient history pontification ---
You know I did exactly the same benchmark when I wrote PDL 1.0, I
kept it
as a gold standard that a basic arithmetic loop on a huge array would
take the
same time as pure C.
I am actually pleased and surprised to hear this is still true. It
got quite slow at one
point during PDL 2.x when threading kept in but then Christian and
Tuomas Lukka
did a LOT of hard work on optimization.
Of course the c program may be poorly written, (maybe it would be
faster to cycle thru with an array pointer? ), but I only
understand the
basics of C.
I found no difference between for() looks and ptr incrementing,
probably because any
decent compiler would optimize them to the same thing. I did find I
could get a factor of 2
by writing them in fortran but I didn't want to go there. :-)
Karl
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl