Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: Graphing Software



John Denker wrote:

At 07:32 PM 6/7/00 -0500, Doug Craigen wrote:
One other program you might look into is Matlab (MATrix LABoratory) - or
its open source counterpart Octave.

SCILAB is another open-source creature, similar to Matlab. It's a free
download. It has reasonable documentation, makes beautiful graphs, has
TONS of other features, and generally behaves itself very nicely. (The
linux binaries install easily; I've never tried the windoze or mac
versions.) Bottom line: If you've got data, you need this or something
like it.

You probably suspected the Linux version runs faster - this is what I
always get when I try an "apples-apples" type of comparison. I wasn't
familiar with SCILAB so I downloaded a couple of versions and did some
basic benchmarking of it with Matlab and Octave. Please insert all the
appropriate disclaimers about how hard good benchmarking really is, but
given that I have a certain computer sitting on my desk I want to know
how much difference it is going to make which OS I boot up and what
software I use to perform the sorts of tasks which I typically do. Over
the long term a little research here will pay off big.

Here's some numbers off of a Pentium 200 with 32 MBytes of RAM running
either Win 95, or Redhat Linux 6.1:

I set up a simple script to numerically solve the generic problem of a
surface function whose value is exponentially decaying away from some
central location:

timer() ** set the timer
y = -10 : 0.1 : 10; ** makes a 201 point vector with values
from -10 to +10
y = y'*ones(1,201); ** turns it into a square matrix
timer() ** see how long it took
y = (y.^2 + y'.^2)^0.5; ** finds the distance from the center
timer() ** see how long it took
y = exp(-y); ** takes the exponential of each element
timer() ** see how long it took

{
(use tic/toc instead of timer in Octave and Matlab)
This is not a very elegant script as is, its writing was dictated by
trying to be compatible with all three programs. Octave and Matlab are
pretty close, but so far SCILAB seems to do a lot of basic things a bit
differently. A better way to write the middle step for Octave or Matlab
is
y = abs(y + i*y');
but I couldn't find the SCILAB equivalent.
}

We now have a 201X201 matrix of calculated values, approximately 40,000
numbers. I also ran from -15 to 15 and -20 to 20, for 90,000 and
160,000 size arrays. In the last case I had to muck about with memory a
bit on SCILAB, setting stacksize(2000000).

The middle step that wasn't written efficiently was by far the most time
consuming. The three steps took Matlab 0.05, 13.57, and 0.17 seconds
respectively for 201X201. Here's what I found in total, where the three
columns refer to time taken (in seconds) for the three array sizes.

40,000 90,000 160,000
----- ----- ------
Matlab 4.2 (Win) 13.57 68.05 152.75
Scilab 2.5 (Win) 15.87 58.88 156.6
Scilab 2.5 (Lin) 10.16 41.08 116.72
Octave 2.0 (Lin) 13.55 47.72 117.80

I wouldn't want to make too many claims about anything else, I'm just
presenting the numbers. The version of Matlab I have is 6 years old,
plus if I use the more efficient form of the middle step (y = abs(y +
i*y')) it takes 9.11 seconds under Matlab, for a total time of less than
10 seconds to run the script with 160,000 points in the array. So a lot
of this boils down to how well you can use whichever one you have with
optimum scripting and memory management, not what works best on a lowest
common denominator type of script, and that makes good benchmarking much
harder.

What I think is fair to conclude is:
1) Scilab appears to run better under Linux than under Windows
2) Of the 4 programs, the two linux ones outperformed the two Windows
ones on identical operations.

This second point is perhaps not very strong based only on this test,
but its a conclusion I come back to whenever I try testing out large
scale number crunching. The more I challenge the system with
calculations that push memory to the limit, the farther ahead Linux
comes. I made up one window/memory/calculation management program that
brought Windows to a halt with about 7 simultaneous instances running,
but I was able run 50 instances under Linux. A friend of mine doing the
SETI-at-home thing says the calculations run 5 times faster when he is
running his system under Linux. This is why many of us type "Windoze".

Its how the system handles big calculations that I really care about
too. Whether a small calculation takes one or two seconds is no big
deal, but whether the big ones take one or two hours is a very big
deal. The fact that under Linux I can perform other tasks with my
computer while running a large calculation is a big plus too.

()-()-()-()-()-()-()-()-()-()-()-()-()-()-()-()

Doug Craigen
http://www.dctech.com/physics/