octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #58445] significant slow down in stable versio


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #58445] significant slow down in stable version for cellfun invocations which use function handles
Date: Tue, 26 May 2020 16:16:12 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Firefox/68.0

Follow-up Comment #5, bug #58445 (project octave):

Thanks and sorry for the trouble.  I should have just looked at the docs.

But under the description for the "func" argument it says that functions may
be passed by name but that it only works for a subset of function names and
"numel" is not included in the list.  So it looks like we were attempting to
handle "numel" in addition to "prodofsize" (What?  I don't even remember any
mention of that one before now!?).

When we have a string argument, we have special cases that dispatch directly
to octave_value methods, which explains why those are fast.

With function handles we are currently doing a function lookup in all cases. 
In the past we tried to avoid that but I think our check for the case of no
function overloads could be incorrect, so that's why it was removed and
cellfun became slower.

We should be able to do better by doing lookups more efficiently when we see
the same types for a given function name.  I'm thinking of caching the exact
function to call based on the list of argument types, but maybe there is a
better way?


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58445>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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