Print

Print


I wrote a little program (attached as a gnuzip-compressed tar file).

The main program calls three subroutines.  Each one creates eight arrays,
and calls a subroutine in a different module that doesn't do much of
anything (even though its name is "do_something" -- that's just to fool
the compiler:).

One of the three intermediate routines creates allocatable arrays, one
creates automatic arrays, and one creates pointer arrays.  The bottom
routine just assigns zero to the first element of each array.

Here are the results for two processors, allocating 100x200 arrays,
calling each of the intermediate routines a million times, on a 998.321
MHz Pentium III (Coppermine) with 256 KB cache running RedHat Linux 8.0:

Times for ALLOC, AUTO and POINT:     30.81     30.02     30.73

Times for ALLOC, AUTO and POINT:      2.99      5.91      5.46

These results are surprising for two reasons:

1.  The second processor's allocator is ten(!) times faster than the first
    processor's.

2.  While automatic arrays are slightly more efficient in the first
    processor (I was expecting more of a difference), they are the LEAST
    efficient alternative in the case of the second processor (although
    still five times faster than with the first processor).

--
Van Snyder                    |  What fraction of Americans believe
[log in to unmask]     |  Wrestling is real and NASA is fake?
Any alleged opinions are my own and have not been approved or disapproved
by JPL, CalTech, NASA, Sean O'Keefe, George Bush, the Pope, or anybody else.