This is a static copy of a profile report

Home

validateVariableNameLength (Calls: 16, Time: 0.004 s)
Generated 16-Jul-2020 17:09:34 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/datatypes/tabular/+matlab/+internal/+tabular/validateVariableNameLength.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
varNamesDim>varNamesDim.makeValidNameclass method8
metaDim>metaDim.checkAgainstVarLabelsclass method8
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
8
nameLengths = strlength(names)...
160.003 s81.9%
15
elseif all(nameLengths > 0)
160.000 s5.1%
19
end
160.000 s1.2%
9
tooLong = (nameLengths > na...
160.000 s0.7%
10
if any(tooLong)
160.000 s0.2%
All other lines  0.000 s10.8%
Totals  0.004 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
strlengthfunction160.002 s65.9%
Self time (built-ins, overhead, etc.)  0.001 s34.1%
Totals  0.004 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function19
Non-code lines (comments, blank lines)8
Code lines (lines that can run)11
Code lines that did run5
Code lines that did not run6
Coverage (did run/can run)45.45 %
Function listing
time 
Calls 
 line
   1 
function tooLong = validateVariableNameLength(names,tooLongErrorID)
   2 
%VALIDATEVARIABLENAMELENGTH checks that variable names do not exceed namelengthmax.
   3 
%   This function takes a cell array of variable names and errors if any are longer
   4 
%   than namelengthmax.
   5 

   6 
%   Copyright 2018-2019 The MathWorks, Inc.
   7 

  0.003 
     16 
   8
nameLengths = strlength(names); 
< 0.001 
     16 
   9
tooLong = (nameLengths > namelengthmax); 
< 0.001 
     16 
  10
if any(tooLong) 
  11 
    TooLongNames = names(tooLong);
  12 
    if nargout == 0
  13 
        error(message(tooLongErrorID, TooLongNames{1}))
  14 
    end
< 0.001 
     16 
  15
elseif all(nameLengths > 0) 
  16 
    % good names
  17 
else % 0-length or NaN. 
  18 
    error(message('MATLAB:table:ZeroLengthVarname')) % Not hit by metaDim
< 0.001 
     16 
  19
end 

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