This is a static copy of a profile report

Home

ReadTable>ReadTable.execute (Calls: 2, Time: 0.398 s)
Generated 04-Jun-2021 04:11:08 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
...ExecutableFunction.validateAndExecuteclass method2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
33
func.Options = func.execute@ma...
20.226 s56.8%
44
t = func.execute@matlab.io.int...
20.153 s38.4%
49
t.Properties.VariableNames(ext...
20.008 s2.1%
13
func.EmptyColumnType = 'double...
20.005 s1.3%
48
names = matlab.lang.makeUnique...
20.002 s0.4%
All other lines  0.004 s0.9%
Totals  0.398 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...ptions>DetectImportOptions.executeclass method20.225 s56.6%
...gt;ReadTableWithImportOptions.executeclass method20.153 s38.4%
tabular.subsasgnfunction20.008 s1.9%
...tectImportOptions.set.EmptyColumnTypeclass method20.005 s1.2%
makeUniqueStringsfunction20.001 s0.3%
tabular.subsreffunction20.000 s0.1%
tabular.heightfunction20.000 s0.1%
tabular.widthfunction20.000 s0.1%
...ns>ImportOptions.get.VariableNamesclass method20.000 s0.1%
composefunction20.000 s0.0%
Self time (built-ins, overhead, etc.)  0.005 s1.3%
Totals  0.398 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function43
Non-code lines (comments, blank lines)6
Code lines (lines that can run)37
Code lines that did run19
Code lines that did not run18
Coverage (did run/can run)51.35 %
Function listing
time 
Calls 
 line
  10 
        function t = execute(func,supplied)
  11 
            % Detect the appropriate object by file type
< 0.001 
      2 
  12
            if ~supplied.EmptyColumnType 
  0.005 
      2 
  13
                func.EmptyColumnType = 'double'; 
< 0.001 
      2 
  14
            end 
< 0.001 
      2 
  15
            if supplied.Delimiter 
  16 
                d = string(func.Delimiter);
  17 
                if isscalar(d)
  18 
                    switch (d{1})
  19 
                        case 'comma'
  20 
                            func.Delimiter = ',';
  21 
                        case 'semi'
  22 
                            func.Delimiter = ';';
  23 
                        case 'space'
  24 
                            func.Delimiter = ' ';
  25 
                        case 'tab'
  26 
                            func.Delimiter = '\t';
  27 
                        case 'bar'
  28 
                            func.Delimiter = '|';
  29 
                    end
  30 
                end
< 0.001 
      2 
  31
            end 
< 0.001 
      2 
  32
            func.PreserveRange = supplied.Range; 
  0.226 
      2 
  33
            func.Options = func.execute@matlab.io.internal.functions.DetectImportOptions(supplied); 
< 0.001 
      2 
  34
            if supplied.Encoding 
  35 
                % The import options now carries the encoding. No need to
  36 
                % pass it on.
  37 
                supplied.Encoding = false; 
< 0.001 
      2 
  38
            end 
< 0.001 
      2 
  39
            if supplied.TreatAsMissing && ~isempty(func.TreatAsMissing) 
  40 
                func.Options = func.Options.setvaropts(func.Options.SelectedVariableNames,...
  41 
                    'TreatAsMissing',func.TreatAsMissing);
< 0.001 
      2 
  42
            end 
  43 
            
  0.153 
      2 
  44
            t = func.execute@matlab.io.internal.functions.ReadTableWithImportOptions(supplied); 
< 0.001 
      2 
  45
            if height(t) > 0  
< 0.001 
      2 
  46
                names = t.Properties.VariableNames; 
  0.001 
      2 
  47
                extraIdx = numel(func.Options.VariableNames)+1:width(t); 
  0.002 
      2 
  48
                names = matlab.lang.makeUniqueStrings(compose('Var%d',extraIdx),names,namelengthmax); 
  0.008 
      2 
  49
                t.Properties.VariableNames(extraIdx) = names; 
< 0.001 
      2 
  50
            end 
  51 
            
< 0.001 
      2 
  52
        end 

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