This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
FastVarOpts>FastVarOpts.getVarOptsclass method30
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
717
opts = NumericVariableImportOp...
150.016 s61.8%
759
opts = TextVariableImportOptio...
150.009 s32.9%
716
case {'uint8','uint16','uint32...
300.000 s1.6%
758
case {'char','string'}
150.000 s1.1%
706
usingFillValue = isfield(args,...
300.000 s0.6%
All other lines  0.000 s1.9%
Totals  0.026 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...tOptions.NumericVariableImportOptionsclass method150.015 s58.4%
...portOptions.TextVariableImportOptionsclass method150.008 s30.5%
Self time (built-ins, overhead, etc.)  0.003 s11.1%
Totals  0.026 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function64
Non-code lines (comments, blank lines)8
Code lines (lines that can run)56
Code lines that did run20
Code lines that did not run36
Coverage (did run/can run)35.71 %
Function listing
time 
Calls 
 line
 701 
function opts = getTypedOpts(t,args)
 702 
import matlab.io.*
 703 
% FillValue may be stored in the low level representation for each type and
 704 
% valid values may depend on the other args, so assigning it separately
 705 
% avoids order-or-eval issues.
< 0.001 
     30 
 706
usingFillValue = isfield(args,'FillValue'); 
< 0.001 
     30 
 707
if usingFillValue 
 708 
    fv = args.FillValue;
 709 
    args = rmfield(args,'FillValue');
< 0.001 
     30 
 710
end 
< 0.001 
     30 
 711
userSuppliedType = isfield(args,'Type'); 
< 0.001 
     30 
 712
if userSuppliedType 
 713 
    args = rmfield(args,'Type');
< 0.001 
     30 
 714
end 
< 0.001 
     30 
 715
switch t 
< 0.001 
     30 
 716
    case {'uint8','uint16','uint32','uint64','int8','int16','int32','int64','double','single','auto'} 
  0.016 
     15 
 717
        opts = NumericVariableImportOptions('Type',t,args); 
< 0.001 
     15 
 718
        if usingFillValue, opts.FillValue = fv; end 
< 0.001 
     15 
 719
    case 'datetime' 
 720 
        opts = DatetimeVariableImportOptions(args);
 721 
        if usingFillValue
 722 
            if ismissing(fv)
 723 
                fv = datetime.fromMillis(NaN + 0i);
 724 
            elseif ~isdatetime(fv)
 725 
                fv = datetime.fromMillis(fv);
 726 
            end
 727 
            if ~strcmp(opts.DatetimeFormat, 'default')
 728 
                fv.Format = opts.DatetimeFormat;
 729 
            end
 730 
            opts.FillValue = fv;
 731 
        end
< 0.001 
     15 
 732
    case 'duration' 
 733 
        opts = DurationVariableImportOptions(args);
 734 
        if usingFillValue
 735 
            if ~isduration(fv)
 736 
                fv = milliseconds(fv);
 737 
            end
 738 
            if ~strcmp(opts.DurationFormat, 'default')
 739 
                fv.Format = opts.DurationFormat;
 740 
            end
 741 
            opts.FillValue = fv;
 742 
        end
< 0.001 
     15 
 743
    case 'logical' 
 744 
        opts = LogicalVariableImportOptions(args);
 745 
        if usingFillValue, opts.FillValue = fv; end
< 0.001 
     15 
 746
    case 'categorical' 
 747 
        opts = CategoricalVariableImportOptions(args);
 748 
        if usingFillValue
 749 
            % There's never a reason this should fail unless the categories
 750 
            % were changed after setting the FillValue, in that case, just
 751 
            % assign '', which is Undefined.
 752 
            try
 753 
                opts.FillValue = fv;
 754 
            catch
 755 
                opts.FillValue = '';
 756 
            end
 757 
        end
< 0.001 
     15 
 758
    case {'char','string'} 
  0.009 
     15 
 759
        opts = TextVariableImportOptions('Type',t,args); 
< 0.001 
     15 
 760
        if usingFillValue 
 761 
            opts.FillValue_ = fv;
< 0.001 
     15 
 762
        end 
< 0.001 
     30 
 763
end 
< 0.001 
     30 
 764
end 

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