This is a static copy of a profile report

Home

Function details for compareFiguresThis is a static copy of a profile report

Home

compareFigures (Calls: 5, Time: 0.014 s)
Generated 28-Jun-2020 10:10:21 using performance time.
function in file /Applications/MATLAB_R2018a.app/toolbox/matlab/codetools/+internal/+matlab/+publish/compareFigures.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...Figures>PublishFigures.leavingCellclass method5
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
35
[unchanged, iNewToOld] = ismem...
50.011 s82.1%
58
clear global PUBLISHING_DEBUGG...
50.000 s2.9%
42
for iNew = find(unchanged)
50.000 s2.6%
34
newId = newItems.id;
50.000 s2.6%
21
if isempty(PUBLISHING_DEBUGGIN...
50.000 s2.1%
All other lines  0.001 s7.7%
Totals  0.014 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
ismemberfunction50.011 s78.4%
Self time (built-ins, overhead, etc.)  0.003 s21.6%
Totals  0.014 s100% 
Code Analyzer results
Line numberMessage
Coverage results
Show coverage for parent directory
Total lines in function61
Non-code lines (comments, blank lines)33
Code lines (lines that can run)28
Code lines that did run15
Code lines that did not run13
Coverage (did run/can run)53.57 %
Function listing
time 
Calls 
 line
   1 
function itemsToSnap = compareFigures(oldItems, newItems)
   2 
%COMPAREFIGURES	Compare figures to baseline.
   3 
%   COMPAREFIGURES lists the figures or systems that have changed.
   4 

   5 
% Copyright 1984-2017 The MathWorks, Inc.
   6 

   7 
% The publishing tools use this 
   8 

   9 
% OLDITEMS and NEWITEMS are structures returned by CAPTUREFIGURES or
  10 
% SNAPNOW>CAPTURESYSTEMS, which are assumed to have the following
  11 
% structure:
  12 
%
  13 
% x.id is a row vector of numeric handles, or names in a cell array 
  14 
% x.data(k) is data that describes x.id(k).
  15 
%
  16 
% If corresponding data is equal between new and old items, the figure or 
  17 
% system is assumed to be unchanged. 
  18 

  19 
% Set this global variable and PUBLISH displays debugging info.
< 0.001 
      5 
  20
global PUBLISHING_DEBUGGING_FLAG 
< 0.001 
      5 
  21
if isempty(PUBLISHING_DEBUGGING_FLAG) 
< 0.001 
      5 
  22
    debug = false; 
  23 
else
  24 
    debug = PUBLISHING_DEBUGGING_FLAG;
< 0.001 
      5 
  25
end 
  26 

  27 
% For compatibility with previous versions
< 0.001 
      5 
  28
if nargin == 1 
  29 
    newItems = internal.matlab.publish.captureFigures;
  30 
end
  31 

  32 
% Assume (for now), that old figures have no changes.
< 0.001 
      5 
  33
oldId = oldItems.id; 
< 0.001 
      5 
  34
newId = newItems.id; 
  0.011 
      5 
  35
[unchanged, iNewToOld] = ismember(newId, oldId); 
  36 

< 0.001 
      5 
  37
if debug 
  38 
    debugDispNew(newItems, unchanged)
  39 
end
  40 

  41 
% Check old figures in detail.
< 0.001 
      5 
  42
for iNew = find(unchanged) 
  43 
    iOld = iNewToOld(iNew);
  44 
    
  45 
    unchanged(iNew) = isequaln( ...
  46 
        oldItems.data(iOld), newItems.data(iNew));
  47 
    
  48 
    if debug
  49 
        debugDispChanges(oldItems, iOld, newItems, iNew, unchanged)
  50 
    end
  51 
end
  52 

  53 
% Form list of those that have changed.
< 0.001 
      5 
  54
itemsToSnap = newItems.id(~unchanged); 
  55 

  56 
% If it is empty, this file probably created it.  Clean it up.
< 0.001 
      5 
  57
if isempty(PUBLISHING_DEBUGGING_FLAG) 
< 0.001 
      5 
  58
    clear global PUBLISHING_DEBUGGING_FLAG 
< 0.001 
      5 
  59
end 
  60 

< 0.001 
      5 
  61
end 

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