This is a static copy of a profile report

Home

hgbehaviorfactory>localCreate (Calls: 32, Time: 0.023 s)
Generated 16-Jul-2020 17:09:26 using performance time.
subfunction in file /Applications/MATLAB_R2020a.app/toolbox/matlab/graphics/hgbehaviorfactory.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
hgbehaviorfactoryfunction32
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
43
dat = localGetBehaviorInfo(hOb...
320.011 s47.6%
52
bh = feval(info.constructor);
320.008 s32.5%
59
end
3840.001 s5.1%
48
info = dat{n};
3840.001 s4.3%
49
s = strcmpi(behavior_name,info...
3840.001 s3.8%
All other lines  0.002 s6.8%
Totals  0.023 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
hgbehaviorfactory>localGetBehaviorInfosubfunction320.011 s45.4%
...>PlotEditBehavior.PlotEditBehaviorclass method160.001 s6.3%
...havior>PrintBehavior.PrintBehaviorclass method160.001 s5.6%
Self time (built-ins, overhead, etc.)  0.010 s42.7%
Totals  0.023 s100% 
Code Analyzer results
Line numberMessage
56The variable 'ret_h' appears to change size on every loop iteration. Consider preallocating for speed.
Coverage results
Show coverage for parent directory
Total lines in function20
Non-code lines (comments, blank lines)5
Code lines (lines that can run)15
Code lines that did run13
Code lines that did not run2
Coverage (did run/can run)86.67 %
Function listing
time 
Calls 
 line
  40 
function [ret_h] = localCreate(behavior_name, hObj)
  41 

< 0.001 
     32 
  42
ret_h = []; 
  0.011 
     32 
  43
dat = localGetBehaviorInfo(hObj); 
  44 
% Note that ret_h cannot be used to accumulate both MCOS and UDD behavior
  45 
% objects. This should not happen currently since hgbehaviorfacotry is not
  46 
% called with a cell array of behavior_name. 
< 0.001 
     32 
  47
for n = 1:length(dat) 
< 0.001 
    384 
  48
     info = dat{n}; 
< 0.001 
    384 
  49
     s = strcmpi(behavior_name,info.name); 
< 0.001 
    384 
  50
     if any(s) 
< 0.001 
     32 
  51
         behavior_name(s) = []; 
  0.008 
     32 
  52
         bh = feval(info.constructor); 
< 0.001 
     32 
  53
         if isempty(ret_h) 
< 0.001 
     32 
  54
             ret_h = bh; 
  55 
         else
  56 
             ret_h(end+1) = bh;
< 0.001 
     32 
  57
         end 
< 0.001 
    384 
  58
     end 
  0.001 
    384 
  59
end 

Other subfunctions in this file are not included in this listing.