This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
...rtOptionsSpreadsheet.getOptsFromSheetclass method2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
185
props = getSuppliedProperties(...
20.001 s33.2%
181
types = opts.fast_var_opts.Typ...
20.001 s25.0%
206
if supplied.DateLocale &&a...
20.000 s5.8%
183
if any(isNumericVar)
20.000 s5.7%
200
props = getSuppliedProperties(...
20.000 s4.8%
All other lines  0.001 s25.5%
Totals  0.003 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...mportOptions>getSuppliedPropertiesclass method40.001 s29.8%
FastVarOpts>FastVarOpts.get.Typesclass method20.000 s11.5%
Self time (built-ins, overhead, etc.)  0.002 s58.7%
Totals  0.003 s100% 
Code Analyzer results
Line numberMessage
Coverage results
Show coverage for parent directory
Total lines in function32
Non-code lines (comments, blank lines)8
Code lines (lines that can run)24
Code lines that did run19
Code lines that did not run5
Coverage (did run/can run)79.17 %
Function listing
time 
Calls 
 line
 179 
        function opts = setVariableProps(func,supplied,opts)
 180 
            % Set the numeric only properties
< 0.001 
      2 
 181
            types = opts.fast_var_opts.Types; 
< 0.001 
      2 
 182
            isNumericVar = (types == "double"); 
< 0.001 
      2 
 183
            if any(isNumericVar) 
< 0.001 
      2 
 184
                props = ["DecimalSeparator","ThousandsSeparator","TrimNonNumeric"]; 
< 0.001 
      2 
 185
                props = getSuppliedProperties(props, supplied);                         
< 0.001 
      2 
 186
                if ~isempty(props) 
 187 
                    opts.fast_var_opts = opts.fast_var_opts.assignVarOptsProps(func, props, isNumericVar);
      2 
 188
                end 
< 0.001 
      2 
 189
            end 
 190 
            % Set the duration DecimalSeparator
< 0.001 
      2 
 191
            isDurationVar = (types == "duration"); 
< 0.001 
      2 
 192
            if supplied.DecimalSeparator && any(isDurationVar)  
 193 
                opts.fast_var_opts = opts.fast_var_opts.assignVarOptsProps(func, "DecimalSeparator", isDurationVar);
< 0.001 
      2 
 194
            end 
 195 
            
 196 
            % set the common properties which can be passed in to
 197 
            % detectImportOptions.
< 0.001 
      2 
 198
            props = ["TreatAsMissing","EmptyFieldRule","QuoteRule",... 
 199 
                "Prefixes","Suffixes"];
< 0.001 
      2 
 200
            props = getSuppliedProperties(props, supplied);                         
< 0.001 
      2 
 201
            if ~isempty(props) 
 202 
                opts.fast_var_opts = opts.fast_var_opts.assignVarOptsProps(func, props, 1:opts.fast_var_opts.numVars);
< 0.001 
      2 
 203
            end 
 204 
            
< 0.001 
      2 
 205
            isDateVar = (types == "datetime"); 
< 0.001 
      2 
 206
            if supplied.DateLocale && any(isDateVar) 
 207 
                sDateTimeLocale = struct("DatetimeLocale", func.DateLocale);
 208 
                opts.fast_var_opts = opts.fast_var_opts.assignVarOptsProps(sDateTimeLocale, "DatetimeLocale", isDateVar);
< 0.001 
      2 
 209
            end 
< 0.001 
      2 
 210
        end 

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