This is a static copy of a profile report

Home

tabular.disp>getVarNamesDispLines (Calls: 8, Time: 0.009 s)
Generated 16-Jul-2020 17:09:56 using performance time.
nested function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/datatypes/tabular/@tabular/disp.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
tabular.dispfunction8
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
295
ulStrs(ii) = nUnder(ulDispWidt...
560.001 s14.3%
320
underlines = leadingSpaces + j...
80.001 s10.5%
286
varnameNumCharsToDisp,'both','...
560.001 s7.8%
264
varStrs = strings(1,t.varDim.l...
80.001 s7.6%
284
varnameNumCharsToDisp = strlen...
560.001 s7.1%
All other lines  0.005 s52.7%
Totals  0.009 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
tabular.disp>nUndersubfunction560.001 s9.0%
tabular.disp>nSpacessubfunction160.000 s1.1%
Self time (built-ins, overhead, etc.)  0.008 s89.9%
Totals  0.009 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function60
Non-code lines (comments, blank lines)30
Code lines (lines that can run)30
Code lines that did run22
Code lines that did not run8
Coverage (did run/can run)73.33 %
Function listing
time 
Calls 
 line
 262 
    function [varnames,nestedVarnames,underlines] = getVarNamesDispLines()
 263 
 
< 0.001 
      8 
 264
        varStrs = strings(1,t.varDim.length); 
< 0.001 
      8 
 265
        ulStrs = strings(1,t.varDim.length); 
< 0.001 
      8 
 266
        if haveNestedTable, nestedVarnameDispWidths = ceil(vectorizedWrappedLength(nestedVarnameStrs)); end 
 267 
        
< 0.001 
      8 
 268
        for ii = 1:t.varDim.length 
< 0.001 
     56 
 269
            varname = varNames(ii); 
 270 
            % Use the wider of varDispWidth and varNamesDispWidth to
 271 
            % determine the header width and pad to the varDispWidth if
 272 
            % necessary. However, when padding, this number has to be
 273 
            % adjusted to account for the fact that the number of
 274 
            % characters in the char vector for the varname do not
 275 
            % correspond to the display width, due to:
 276 
            % * Strong tags
 277 
            % * Hyperlinks (and thus no strong tags)
 278 
            % * Wide characters
 279 
            % * Narrow characters or wide-displaying characters that don't
 280 
            % report to be wide (nothing to be done about those).
 281 

 282 
            % Pad out variable names if necessary to match the data display
 283 
            % width. Varnames have already been made bold.
< 0.001 
     56 
 284
            varnameNumCharsToDisp = strlength(varname) + (varDispWidths(ii) - varNameDispWidths(ii)); 
< 0.001 
     56 
 285
            varStrs(ii) = pad(varname, ... % wrap tightly with strong tags 
     56 
 286
                              varnameNumCharsToDisp,'both',' '); 
< 0.001 
     56 
 287
            if haveNestedTable 
 288 
                % Pad the nested var names out to the full data display width,
 289 
                % accounting for bold markup tags around each nested name.
 290 
                nestedVarnameStrs(ii) = pad(nestedVarnameStrs(ii), ...
 291 
                                            strlength(nestedVarnameStrs(ii)) + (varDispWidths(ii) - nestedVarnameDispWidths(ii)),'both',' ');
< 0.001 
     56 
 292
            end 
 293 
            % Create underlines under each variable name to the full data
 294 
            % display width.
  0.001 
     56 
 295
            ulStrs(ii) = nUnder(ulDispWidths(ii)); 
< 0.001 
     56 
 296
        end 
 297 
        
< 0.001 
      8 
 298
        if t.dispRowLabelsHeader 
 299 
            % Need to print the name of the rowDim; add it to the beginning
 300 
            % of the array            
 301 
            ulStrs = [nUnder(rownameWidth), ulStrs];        
 302 
            varStrs = [pad(rowDimName, ... % wrap tightly with strong tags
 303 
                           strlength(rowDimName) + (rownameWidth - rowDimNameWidth),'both',' '), varStrs];
 304 
            nestedVarnameStrs = [nSpaces(rownameWidth), nestedVarnameStrs];
< 0.001 
      8 
 305
        end 
 306 
        
 307 
        % Join all the variable names and underlines with spaces.
< 0.001 
      8 
 308
        spacesBetween = string(nSpaces(between)); 
< 0.001 
      8 
 309
        if ~t.dispRowLabelsHeader && t.rowDim.hasLabels 
 310 
            % table doesn't print a header (dimname) for rownames, but we
 311 
            % still have to account for the width with additional spaces.
< 0.001 
      8 
 312
            leadingSpaces = nSpaces(indent + rownameWidth + between); 
 313 
        else
 314 
            % timetables always wind up here, and tables without rownames
 315 
            leadingSpaces = nSpaces(indent);
< 0.001 
      8 
 316
        end 
 317 
        
< 0.001 
      8 
 318
        varnames = leadingSpaces + join(varStrs,spacesBetween); 
< 0.001 
      8 
 319
        nestedVarnames = leadingSpaces + join(nestedVarnameStrs,spacesBetween); 
< 0.001 
      8 
 320
        underlines = leadingSpaces + join(strongBegin + ulStrs + strongEnd, spacesBetween) + looseline; 
< 0.001 
      8 
 321
    end 

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