This is a static copy of a profile report

Home

ReadTable>ReadTable.buildTableFromData (Calls: 2, Time: 0.055 s)
Generated 04-Jun-2021 04:11:15 using performance time.
class method in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\io\functions\+matlab\+io\+internal\+functions\ReadTable.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...hImportOptionsSpreadsheet.executeImplclass method2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
132
t = table.init(data,numRows,ro...
20.031 s57.5%
134
t.Properties.VariableDescripti...
20.011 s21.0%
99
validNames = matlab.internal.t...
20.006 s11.3%
116
rowNames = matlab.internal.tab...
10.002 s3.1%
103
validNames = matlab.lang.makeU...
20.001 s1.1%
All other lines  0.003 s6.0%
Totals  0.055 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
table.table>table.initclass method20.031 s56.6%
tabular.subsasgnfunction20.011 s19.3%
varNamesDim>varNamesDim.makeValidNameclass method20.006 s10.5%
rowNamesDim>rowNamesDim.makeValidNameclass method10.001 s2.6%
makeUniqueStringsfunction20.001 s1.0%
makeValidNamefunction20.000 s0.7%
Self time (built-ins, overhead, etc.)  0.005 s9.3%
Totals  0.055 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function52
Non-code lines (comments, blank lines)17
Code lines (lines that can run)35
Code lines that did run28
Code lines that did not run7
Coverage (did run/can run)80.00 %
Function listing
time 
Calls 
 line
  85 
        function t = buildTableFromData(data, varNames, rowNames, dimNames, readVarNames, readRowNames, preserveVariableNames)
  86 
            
  87 
            % Change variable name validation and fixing behavior based on the value
  88 
            % of PreserveVariableNames.
< 0.001 
      2 
  89
            if preserveVariableNames 
  90 
                variableNameBehavior = 'warnSaved';
< 0.001 
      2 
  91
            else 
  92 
                % The legacy behavior is to normalize to valid MATLAB identifiers.
< 0.001 
      2 
  93
                variableNameBehavior = 'warnSavedLegacy'; 
< 0.001 
      2 
  94
            end 
  95 
            
  96 
            % Set the var names.  These will be modified to make them valid, and the
  97 
            % original strings saved in the VariableDescriptions property.  Fix up duplicate
  98 
            % or empty names.
  0.006 
      2 
  99
            validNames = matlab.internal.tabular.private.varNamesDim.makeValidName(varNames, variableNameBehavior); 
< 0.001 
      2 
 100
            dimNames = matlab.lang.makeValidName(dimNames); 
 101 

< 0.001 
      2 
 102
            if readVarNames 
< 0.001 
      2 
 103
                validNames = matlab.lang.makeUniqueStrings(validNames,{},namelengthmax); 
< 0.001 
      2 
 104
                reservedNames = [validNames(:); dimNames{1}]; 
< 0.001 
      2 
 105
                if any(strcmp(dimNames{2},reservedNames)) 
 106 
                    % Make sure var names and dim names don't conflict. That could happen if var
 107 
                    % names read from the file are the same as the default dim names (when ReadRowNames
 108 
                    % is false), or same as the first dim name read from the file (ReadRowNames true).
 109 
                    dimNames{2} = matlab.lang.makeUniqueStrings(dimNames{2},reservedNames,namelengthmax);
< 0.001 
      2 
 110
                end 
 111 
            else
 112 
                dimNames{2} = 'Variables';
< 0.001 
      2 
 113
            end 
 114 

< 0.001 
      2 
 115
            if readRowNames 
  0.002 
      1 
 116
                rowNames = matlab.internal.tabular.private.rowNamesDim.makeValidName(rowNames, 'silent'); 
< 0.001 
      2 
 117
            end 
 118 

 119 
            % make dimNames and validNames unqiue
< 0.001 
      2 
 120
            dimnames = convertCharsToStrings(dimNames); 
< 0.001 
      2 
 121
            validnames = convertCharsToStrings(validNames); 
< 0.001 
      2 
 122
            if any(dimnames(:)' == validnames(:), 'all') 
 123 
                dimNames = matlab.lang.makeUniqueStrings(dimNames,validNames,namelengthmax);
< 0.001 
      2 
 124
            end 
 125 

< 0.001 
      2 
 126
            numVars = numel(data); 
< 0.001 
      2 
 127
            if numVars > 0 
< 0.001 
      2 
 128
                numRows = size(data{1}, 1); 
 129 
            else
 130 
                numRows = numel(rowNames);
< 0.001 
      2 
 131
            end 
  0.031 
      2 
 132
            t = table.init(data,numRows,rowNames,numVars,validNames,dimNames); 
< 0.001 
      2 
 133
            if numVars > 0 && any(~strcmp(validNames,varNames)) 
  0.011 
      2 
 134
                t.Properties.VariableDescriptions = varNames; 
< 0.001 
      2 
 135
            end 
< 0.001 
      2 
 136
        end 

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