This is a static copy of a profile report

Home

workspacefunc>getWhosInformation (Calls: 3, Time: 0.001 s)
Generated 18-May-2021 16:05:18 using performance time.
subfunction in file /usr/local/MATLAB/R2021a/toolbox/matlab/codetools/workspacefunc.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
workspacefuncfunction3
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
1538
out = com.mathworks.mlwidgets....
30.000 s50.4%
1537
if numel(in) == 0
30.000 s14.1%
1581
end
30.000 s1.9%
All other lines  0.000 s33.6%
Totals  0.001 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...workspace.WhosInformation.getInstanceJava method30.000 s12.9%
Self time (built-ins, overhead, etc.)  0.001 s87.1%
Totals  0.001 s100% 
Code Analyzer results
Line numberMessage
1538'com.mathworks' package and subpackages will be removed in a future release. There is no simple replacement for this.
1567'com.mathworks' package and subpackages will be removed in a future release. There is no simple replacement for this.
1578'com.mathworks' package and subpackages will be removed in a future release. There is no simple replacement for this.
Coverage results
Show coverage for parent directory
Total lines in function47
Non-code lines (comments, blank lines)20
Code lines (lines that can run)27
Code lines that did run3
Code lines that did not run24
Coverage (did run/can run)11.11 %
Function listing
time 
Calls 
 line
1535 
function out = getWhosInformation(in)
1536 

< 0.001 
      3 
1537
if numel(in) == 0 
< 0.001 
      3 
1538
    out = com.mathworks.mlwidgets.workspace.WhosInformation.getInstance; 
1539 
else
1540 
    % Prune the dataset to only include the deepest nesting level - this
1541 
    % is relevant for nested functions when debugging. The desired behavior
1542 
    % is to only show the variables in the deepest workspace.
1543 
    nesting = [in.nesting];
1544 
    level = [nesting.level];
1545 
    prunedWhosInformation = in(level == max(level));
1546 

1547 
    % Perform a case insensitive sort since "whos" returns the variables
1548 
    % sorted in case sensitive order. Since this case sensitive order
1549 
    % puts capital letters ahead of lower case, reverse it first, so that
1550 
    % the sort resolves matching lower case names with capital letters
1551 
    % after lower case. This ensures that the variables are sorted with an
1552 
    % order that matches the details pane of CSH (944091)
1553 
    names = {prunedWhosInformation.name};
1554 
    [~,I] = sort(lower(names(end:-1:1)));
1555 
    I = length(names)-I+1;
1556 
    sortedWhosInformation = prunedWhosInformation(I);
1557 

1558 
    siz = {sortedWhosInformation.size}';
1559 
    names = {sortedWhosInformation.name};
1560 
    inbytes = [sortedWhosInformation.bytes];
1561 
    inclass = {sortedWhosInformation.class};
1562 
    incomplex = [sortedWhosInformation.complex];
1563 
    insparse = [sortedWhosInformation.sparse];
1564 
    inglobal = [sortedWhosInformation.global];
1565 
    
1566 
    try
1567 
        out = com.mathworks.mlwidgets.workspace.WhosInformation(names, ...
1568 
            siz, inbytes, inclass, incomplex, insparse, inglobal);
1569 
    catch
1570 
        % This may have failed because the number of dimensions in one of
1571 
        % the variables is so large that the java array of dimensions fails
1572 
        % to be created.  Retry using a size of -1x-1, and set the
1573 
        % sizeLengths to be used instead.   Note - using a try/catch
1574 
        % instead of checking beforhand so there's no change in performance
1575 
        % under normal circumstances.
1576 
        sizeLengths = cellfun(@length, siz);
1577 
        siz(sizeLengths > 100000) = {[-1, -1]};
1578 
        out = com.mathworks.mlwidgets.workspace.WhosInformation(names, ...
1579 
            siz, inbytes, inclass, incomplex, insparse, inglobal, sizeLengths);
1580 
    end
< 0.001 
      3 
1581
end 

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