octave-maintainers
[Top][All Lists]
Advanced

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

Re: octave dev slow down


From: Rik
Subject: Re: octave dev slow down
Date: Mon, 19 Jun 2017 16:42:29 -0700

On 06/19/2017 03:18 PM, John W. Eaton wrote:
>
> Could it also improve performance to use templates differently so that we
> can avoid passing function pointers?  I'm thinking that using functions
> as template parameters allows inlining where passing function pointers as
> parameters to a mapping function does not.  But I'm not sure whether
> that's correct.  We currently have a mixture of these styles.  I guess it
> would be good to figure out which is better and be consistent if possible.

I haven't figured out a good way to do profiling on Octave, and I think
that should be the first step.  I have tried to optimize programs without
doing measurements first, and the root cause invariably turns out *not* to
be what you thought it was.

My current speculation--this is without confirmation--is that there are a
lot of temporaries being created whenever any object is created.  For
example, calling the constructor for an array should generally be done with
a dim_vector object.  The dim_vector exists just long enough for the array
constructor to be called and then is destroyed.  If we don't have
lightweight constructors and destructors for frequently used objects like
this then there will be a performance problem.

Another idea I have is that we might start to use move constructors for
some objects.  This would allow transfer of ownership without calling the
copy constructor and might alleviate the problems with heavyweight
constructors (if indeed, they are an actual problem).

--Rik




reply via email to

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