help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: An example of poor C++ performance


From: John W. Eaton
Subject: Re: An example of poor C++ performance
Date: Wed, 23 Feb 2005 18:41:40 -0500

On 23-Feb-2005, Steve C. Thompson <address@hidden> wrote:

| It sounds like you are suggesting that the C++ code needs to be
| vectorized.  But isn't this a compounded hassle?

We could have the octave_rand::scalar() function not check to see
if the generator has been initialized (and require to you to ensure
that that has happened) but that would allow you to do even more silly
things (like try to get the next number in the sequence before the
generator was properly initialized).

The default generator in Octave is known to be slow.  We have
considered changing it, but no decision has been made.

Do you have octave-forge installed?  In that case, the difference you
are seeing is a combined effect of the slower generator in Octave
(compared to the one in octave-forge) and the overhead of calling the
octave_rand::scalar() function.

| I thought that C++ code was just supposed to be ``fast''!

I'd say it depends on what you do with the language.  Comparing the
speed of languages generally doesn't make much sense.  It's like
asking is a hammer faster than a screwdriver.

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]