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 dev version f


From: A.R. Burgers
Subject: [Octave-bug-tracker] [bug #58445] significant slow down in dev version for certain cellfun invocations
Date: Mon, 25 May 2020 17:21:40 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36 Edge/18.17763

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

                 Summary: significant slow down in dev version for certain
cellfun invocations
                 Project: GNU Octave
            Submitted by: arb
            Submitted on: Mon 25 May 2020 09:21:39 PM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Performance
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 6.0.90
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

Certain cellfun invocations have slowed down a lot, a factor 1000 in this
example, for cellfun(@numel). For cellfun('numel') the cellfun call is also a
factor 2.5 slower, but not as dramatic as in the function handle case.

octave 5.2.1 timings:

ver = 5.2.1
cellfun('numel'): 0.128928 secs
cellfun(@numel):  0.00182199 secs


octave-6.0.1 timings:

ver = 6.0.1                                                                   
          
cellfun('numel'): 0.304217 secs                                               
          
cellfun(@numel):  2.28019 secs


Here is the test script that times cellfun(@numel) and cellfun('numel').


ver = version

% aa: 1000x1 cell vector, each cell containing a 1x3 row vector
aa = num2cell(rand(1000,3), 2);

tic;
nrep = 10000;
for j = 1 : nrep
  cellfun('numel', aa);
end
fprintf('cellfun(''numel''): %g secs\n', toc);

tic;
nrep = 100;
for j = 1 : nrep
  cellfun(@numel, aa);
end
fprintf('cellfun(@numel):  %g secs\n', toc);





    _______________________________________________________

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]