This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
...re>FunctionStore.getFunctionByNameclass method2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
18
if isempty(functionMap),functi...
20.000 s44.8%
33
func = functionMap.(name);
20.000 s12.6%
34
return
20.000 s11.1%
28
case 'get'
20.000 s8.0%
17
persistent functionMap;
20.000 s6.0%
All other lines  0.000 s17.6%
Totals  0.001 s100% 
Children (called functions)
No children
Code Analyzer results
Line numberMessage
29This import statement runs before any other code in function 'accessMap'. Consider placing it at the top of the function body.
Coverage results
Show coverage for parent directory
Total lines in function59
Non-code lines (comments, blank lines)8
Code lines (lines that can run)51
Code lines that did run8
Code lines that did not run43
Coverage (did run/can run)15.69 %
Function listing
time 
Calls 
 line
  16 
function func = accessMap(op,name,func)
< 0.001 
      2 
  17
persistent functionMap; 
< 0.001 
      2 
  18
if isempty(functionMap),functionMap = struct();end 
  19 

  20 

  21 
% add a function to the map
< 0.001 
      2 
  22
switch(op) 
< 0.001 
      2 
  23
    case 'add' 
  24 
        if ~isa(func,'matlab.io.internal.functions.ExecutableFunction')
  25 
            error('Not a function');
  26 
        end
  27 
        functionMap.(name) = func;
< 0.001 
      2 
  28
    case 'get' 
  29 
        import matlab.io.internal.functions.*
< 0.001 
      2 
  30
        try 
  31 
            % If a function has already been registered, get that function
  32 
            % from the MAP. (Functions are value objects)
< 0.001 
      2 
  33
            func = functionMap.(name); 
< 0.001 
      2 
  34
            return 
  35 
        catch
  36 
            % Try to add one of the known functions.
  37 
            switch (name)
  38 
                case 'detectImportOptions'
  39 
                    func = DetectImportOptions;
  40 
                case 'readcell'
  41 
                    func = ReadCell;
  42 
                case 'readtable'
  43 
                    func = ReadTable;
  44 
                case 'readmatrix'
  45 
                    func = ReadMatrix;
  46 
                case 'readtimetable'
  47 
                    func = ReadTimeTable;
  48 
                case 'readvars'
  49 
                    func = ReadVars;
  50 
                case 'readlines'
  51 
                    func = ReadLines;
  52 
                case 'readstruct'
  53 
                    func = ReadStruct;
  54 
                case 'table2timetable'
  55 
                    func = Table2Timetable;
  56 
                case 'readtableWithImportOptions'
  57 
                    func = ReadTableWithImportOptions;
  58 
                case 'readtimetableWithImportOptions'
  59 
                    func = ReadTimeTableWithImportOptions;
  60 
                case 'readcellWithImportOptions'
  61 
                    func = ReadCellWithImportOptions;
  62 
                case 'readmatrixWithImportOptions'
  63 
                    func = ReadMatrixWithImportOptions;
  64 
                case 'readvarsWithImportOptions'
  65 
                    func = ReadVarsWithImportOptions;
  66 
                case 'setvaropts'
  67 
                    func = SetVarOpts;
  68 
                otherwise
  69 
                    error('Unknown Function');
  70 
            end
  71 
            functionMap.(name) = func;
  72 
        end
  73 
end
  74 
end

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