help-octave
[Top][All Lists]
Advanced

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

Re: Realtime cost of call by value


From: Glenn Golden
Subject: Re: Realtime cost of call by value
Date: Thu, 30 Oct 2003 21:47:32 -0700

"John W. Eaton" writes:
>
> On 30-Oct-2003, Glenn Golden <address@hidden> wrote:
> |   virtual Matrix& matrix_reference (void) const
> |     { return rep->matrix_reference (); }
> 
> The declaration of this function must match exactly the one in the
> octave_matrix class.  Probably it should not be const.
> 

Ow.  (And I was _missing_ a const from my earlier example...  Maybe
there's some sort of conservation law at work here...)

Anyway... it's taken a little while, but it was well worth it:

    octave:4> ignore_function_time_stamp = "all"
    octave:5> global foo 

    octave:6> foo = rand(1000);
    octave:7> poke;     # DLD: Modify foo(1,1) via get/set_global_value()
    et = 21439.0 usec   # (Dyn. load time is a negligible fraction of this.)


    octave:24> foo = rand(1000);
    octave:25> poke;    # foo(1,1) mod via global_reference()/matrix_reference()
    et = 9.0 usec     

Just a sliiight three order of magnitude improvement.  An extreme
example perhaps, because of the size of the matrix, but even with
the more modest dimensions in my problem, it will still make the
difference between Octave being a feasible (and highly preferable)
solution, vs. it being a non-starter, for speed reasons.  I'm really
happy about this. The fact that Octave can now be used to do this
simulation is going to make it go a lot smoother, and probably faster
to completion as well.  It's a pleasure having a credible alternative
to MathWorks.  (And the help line is better too. :)

So... Tomer, Geraint, and esp. John:  Thanks, bigtime.  The fact
that this works is really going to make my life a lot easier over
the next few weeks.

In a few days, I'll post my 2 cents worth re John's poll question
(about whether this capability become part of the distribution).
Naturally, I think it should, but not just for the sake of my own
application.  I think the efficiency issue is larger than that, and
I'd at least like to try to make the case that it's valuable enough
to have it in the distro, even if it is hidden away and plastered
with caveats. (And if the decision is made to do that, I will certainly
be glad to help with integrating it in whatever way I can.)

Thanks again for all your help,

Glenn



-------------------------------------------------------------
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]