|
From: | Todd Neal |
Subject: | Re: An example of poor C++ performance |
Date: | Wed, 23 Feb 2005 18:37:00 -0600 |
User-agent: | Mozilla Thunderbird 1.0+ (X11/20050218) |
John W. Eaton wrote:
I looked at the source and I am not for certain but it could be the layer upon layer of function call and return that happens when generating a number.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.
Considering a uniform_dist, (1) octave_rand::scalar() calls dgenunf (2) dgenunf calls genunf (3) genunf calls ranf (4) ranf calls ignlgi (5) ignlgi calls a few functions, but essentially generates the number Todd ------------------------------------------------------------- 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 -------------------------------------------------------------
[Prev in Thread] | Current Thread | [Next in Thread] |