This is a static copy of a profile report

Home

varNamesDim>varNamesDim.subs2inds (Calls: 110429, Time: 2.802 s)
Generated 04-Jun-2021 04:11:12 using performance time.
class method in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\datatypes\tabular\+matlab\+internal\+tabular\+private\varNamesDim.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
tabular.getVarOrRowLabelIndicesfunction3
tabular.subsrefParensfunction70595
tabular.subsrefBracesfunction37754
tabular.subsasgnBracesfunction785
tabular.subsasgnParensfunction1292
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
173
obj.subs2inds@matlab.internal....
1104292.224 s79.4%
194
end        
1104290.134 s4.8%
186
elseif isColon(indices)
700880.132 s4.7%
187
indices = 1:obj.length;
700880.054 s1.9%
157
oldLength = obj.length;
1104290.030 s1.1%
All other lines  0.228 s8.1%
Totals  2.802 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...mension>tabularDimension.subs2indsclass method1104291.928 s68.8%
isColonfunction700880.065 s2.3%
Self time (built-ins, overhead, etc.)  0.809 s28.9%
Totals  2.802 s100% 
Code Analyzer results
Line numberMessage
Coverage results
Show coverage for parent directory
Total lines in function45
Non-code lines (comments, blank lines)18
Code lines (lines that can run)27
Code lines that did run16
Code lines that did not run11
Coverage (did run/can run)59.26 %
Function listing
time 
Calls 
 line
 150 
        function [indices,numIndices,maxIndex,isLiteralColon,isLabels,updatedObj] ...
 151 
                     = subs2inds(obj,subscripts,subsType,tData)
 152 
            %SUBS2INDS Convert table subscripts (labels, logical, numeric) to indices.
 153 
            
 154 
            import matlab.internal.datatypes.isColon
 155 
            
  0.007 
 110429 
 156
            try 
  0.030 
 110429 
 157
                oldLength = obj.length; 
 158 
                
  0.006 
 110429 
 159
                if nargin < 3, subsType = matlab.internal.tabular.private.tabularDimension.subsType.reference; end 
 160 
                
 161 
                % Translate a vartype subscript object into actual subscripts.
 162 
                % Do this here, because the tabularDimension superclass's
 163 
                % doesn't know that the vartype's getSubscripts needs to know
 164 
                % the variable types.
  0.006 
 110429 
 165
                if isobject(subscripts) 
 166 
                    if isa(subscripts,'vartype')
 167 
                        subscripts = subscripts.getSubscripts(obj,tData);
 168 
                    end
  0.005 
 110429 
 169
                end 
 170 
                
 171 
                % Let the superclass handle the (rest of the) real work.
  2.229 
 110429 
 172
                [indices,numIndices,maxIndex,isLiteralColon,isLabels,updatedObj] = ... 
 110429 
 173
                    obj.subs2inds@matlab.internal.tabular.private.tabularDimension(subscripts,subsType); 
 174 
                
  0.005 
 110429 
 175
                if isnumeric(subscripts) 
  0.002 
  40341 
 176
                    if maxIndex > oldLength 
 177 
                        if any(diff(unique([oldLength indices(:)'])) > 1)
 178 
                            error(message('MATLAB:table:DiscontiguousVars'));
 179 
                        end
  0.002 
  40341 
 180
                    end 
 181 
                    
 182 
                    % Translate logical and ':' to indices, since table var indexing is not done by
 183 
                    % the built-in indexing code
  0.003 
  70088 
 184
                elseif islogical(indices) 
 185 
                    indices = find(indices);
  0.132 
  70088 
 186
                elseif isColon(indices) 
  0.054 
  70088 
 187
                    indices = 1:obj.length; 
 188 
                elseif isa(indices,'matlab.internal.ColonDescriptor')
 189 
                    indices = indices(:)';
  0.012 
 110429 
 190
                end 
 191 
            catch ME
 192 
                throwAsCaller(ME)
  0.005 
 110429 
 193
            end 
  0.134 
 110429 
 194
        end         

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