This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
hggetbehaviorfunction32
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
93
b = hgbehaviorfactory(bn,h);
320.026 s55.6%
91
b = localPeek(h,bn);
320.004 s9.3%
95
if ~dosupport(b,h)
320.004 s8.8%
99
set(h,'Behavior',bb);
320.004 s8.7%
79
bb = get(h,'Behavior');
320.003 s5.6%
All other lines  0.006 s12.0%
Totals  0.047 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
hgbehaviorfactoryfunction320.025 s53.2%
hggetbehavior>localPeeksubfunction320.004 s8.7%
PrintBehavior>PrintBehavior.dosupportclass method160.002 s3.4%
...ehavior>PlotEditBehavior.dosupportclass method160.002 s3.3%
Self time (built-ins, overhead, etc.)  0.015 s31.5%
Totals  0.047 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function38
Non-code lines (comments, blank lines)8
Code lines (lines that can run)30
Code lines that did run21
Code lines that did not run9
Coverage (did run/can run)70.00 %
Function listing
time 
Calls 
 line
  76 
function [ret_h] = localGet(h,behavior_name)
  77 
% ToDo: Optimize to avoid excessive looping
  78 

  0.003 
     32 
  79
bb = get(h,'Behavior'); 
< 0.001 
     32 
  80
ret_h = []; 
  81 

< 0.001 
     32 
  82
if ischar(behavior_name) 
< 0.001 
     32 
  83
    behavior_name = {behavior_name}; 
< 0.001 
     32 
  84
end 
  85 

  86 
% Note that ret_h cannot be used to accumulate both MCOS and UDD behavior
  87 
% objects. This should not happen currently since hggetbehavior is not
  88 
% called with a cell array of behavior_names. 
< 0.001 
     32 
  89
for n = 1:length(behavior_name) 
< 0.001 
     32 
  90
     bn = behavior_name{n}; 
  0.004 
     32 
  91
     b = localPeek(h,bn); 
  0.001 
     32 
  92
     if isempty(b) 
  0.026 
     32 
  93
        b = hgbehaviorfactory(bn,h); 
< 0.001 
     32 
  94
        if ~isempty(b)  
  0.004 
     32 
  95
            if ~dosupport(b,h) 
  96 
                error(message('MATLAB:hggetbehavior:UnsupportedHandle'))  
< 0.001 
     32 
  97
            end 
  0.001 
     32 
  98
            bb(1).(behavior_name{n}) = b; 
  0.004 
     32 
  99
            set(h,'Behavior',bb); 
< 0.001 
     32 
 100
            if isempty(ret_h) 
< 0.001 
     32 
 101
                ret_h = b; 
 102 
            else
 103 
                ret_h(end+1) = b; %#ok<AGROW>
< 0.001 
     32 
 104
            end 
< 0.001 
     32 
 105
        end 
 106 
     else
 107 
        if isempty(ret_h)
 108 
            ret_h = b;
 109 
        else
 110 
            ret_h(end+1) = b; %#ok<AGROW>
 111 
        end
< 0.001 
     32 
 112
     end 
< 0.001 
     32 
 113
end 

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