This is a static copy of a profile report

Home

validateDataType (Calls: 12, Time: 0.021 s)
Generated 18-May-2021 16:05:26 using performance time.
function in file /usr/local/MATLAB/R2021a/toolbox/matlab/validators/+matlab/+internal/+validation/validateDataType.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
Button.Button>Button.Buttonclass method8
...uttonImage>ButtonImage.ButtonImageclass method4
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
12
H = matlab.internal.validation...
40.015 s71.7%
25
[value, ex] = validateSize(H, ...
40.003 s13.1%
8
if (isempty(validation.class) ...
120.002 s8.1%
15
if ~isa(value, H.ClassName)
40.000 s2.0%
28
end
40.000 s0.9%
All other lines  0.001 s4.1%
Totals  0.021 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...>ValidationHelper.ValidationHelperclass method40.003 s16.0%
...lper>ValidationHelper.validateSizeclass method40.002 s10.5%
Self time (built-ins, overhead, etc.)  0.015 s73.5%
Totals  0.021 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function38
Non-code lines (comments, blank lines)15
Code lines (lines that can run)23
Code lines that did run14
Code lines that did not run9
Coverage (did run/can run)60.87 %
Function listing
time 
Calls 
 line
   1 
function value = validateDataType(validation, value, invokeValidation)   
   2 
     % Helper function to validate the values contained in the valdiation
   3 
     % struct injected for typed properties
   4 

   5 
     % Copyright 2018-2020 The MathWorks, Inc.
   6 

   7 
     % avoid creating ValidationHelper object if there is no need
  0.002 
     12 
   8
     if (isempty(validation.class) || isa(value, validation.class)) && isempty(validation.dimensions) && ~invokeValidation 
< 0.001 
      8 
   9
         return; 
< 0.001 
      4 
  10
     end 
  11 
         
  0.015 
      4 
  12
     H = matlab.internal.validation.ValidationHelper(validation); 
  13 

  14 
     % do class conversion
< 0.001 
      4 
  15
     if ~isa(value, H.ClassName) 
  16 
         % g1984150 TODO: Change the call to use validateClass.
  17 
         [value, ex] = validateClassForDataTypeUseCase(H, value);
  18 
         if ~isempty(ex)
  19 
             throwAsCaller(ex);
  20 
         end
< 0.001 
      4 
  21
     end 
  22 

  23 
    % do size conversion
< 0.001 
      4 
  24
    if ~isempty(H.CodedSize) 
  0.003 
      4 
  25
        [value, ex] = validateSize(H, value); 
< 0.001 
      4 
  26
        if ~isempty(ex) 
  27 
            throwAsCaller(ex);
< 0.001 
      4 
  28
        end 
< 0.001 
      4 
  29
    end 
  30 

  31 
    % apply validators
< 0.001 
      4 
  32
    if invokeValidation 
  33 
        ex = validateUsingValidationFunctions(H, value);
  34 
        if ~isempty(ex)
  35 
            throwAsCaller(ex);
  36 
        end
< 0.001 
      4 
  37
    end 
< 0.001 
      4 
  38
end 

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