This is a static copy of a profile report

Home

docroot (Calls: 1, Time: 0.002 s)
Generated 18-May-2021 16:05:18 using performance time.
function in file /usr/local/MATLAB/R2021a/toolbox/matlab/helptools/docroot.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
findDocCatalogFilesfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
50
helpDir = strrep(char(com.math...
10.001 s72.0%
49
if usejava('jvm')
10.000 s25.0%
20
if nargin > 0
10.000 s1.0%
53
end
10.000 s0.4%
46
end
10.000 s0.1%
All other lines  0.000 s1.5%
Totals  0.002 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
opaque.charfunction10.001 s50.4%
usejavafunction10.000 s17.3%
....mlservices.MLHelpServices.getDocRootJava method10.000 s2.5%
Self time (built-ins, overhead, etc.)  0.001 s29.8%
Totals  0.002 s100% 
Code Analyzer results
Line numberMessage
30'com.mathworks' package and subpackages will be removed in a future release. There is no simple replacement for this.
50'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 function53
Non-code lines (comments, blank lines)24
Code lines (lines that can run)29
Code lines that did run5
Code lines that did not run24
Coverage (did run/can run)17.24 %
Function listing
time 
Calls 
 line
   1 
function helpDir = docroot(new_docroot)
   2 
%DOCROOT A utility to get or set the root directory of MATLAB Help
   3 
%   DOCROOT returns the current docroot.
   4 
%   DOCROOT(NEW_DOCROOT) sets the docroot to the new docroot, whether or
   5 
%   not the new docroot is a valid directory.  A warning is printed out if
   6 
%   the directory appears to be invalid.
   7 
%
   8 
%   The documentation root directory is set by default to be
   9 
%   MATLABROOT/help.  This value should not need to be changed, since
  10 
%   documentation in other locations may not be compatible with the running
  11 
%   version. However, if documentation from another location is desired,
  12 
%   docroot can be changed by calling this function to set the value to
  13 
%   another directory. This value is not saved in between sessions.  To set
  14 
%   this value every time MATLAB is run, a call to docroot can be inserted
  15 
%   into startup.m.
  16 

  17 
%   Copyright 1984-2020 The MathWorks, Inc.
  18 

  19 
% If at least one argument is passed in, set user docpath
< 0.001 
      1 
  20
if nargin > 0 
  21 
    stringIn = isstring(new_docroot);
  22 
    if stringIn
  23 
        new_docroot = char(new_docroot);
  24 
    end
  25 
    if (usejava('jvm') == 1)
  26 
        % remove trailing directory separator
  27 
        if (~isempty(new_docroot) && new_docroot(end)==filesep)
  28 
            new_docroot = new_docroot(1:end-1);
  29 
        end
  30 
        if ~com.mathworks.mlservices.MLHelpServices.setDocRoot(new_docroot)
  31 
            % warn the user that docroot doesn't look like a valid docroot
  32 
            warning(message('MATLAB:docroot:InvalidDirectoryNotSet'));
  33 
        end
  34 
        helpDir = new_docroot;
  35 
    else
  36 
        helpDir = fullfile(matlabroot, 'help');
  37 
        disp(getString(message('MATLAB:docroot:ChangingDocrootNotSupported')));
  38 
    end
  39 
    if stringIn
  40 
        helpDir = string(helpDir);
  41 
    end
  42 
    
  43 
    matlab.internal.doc.updateConnectorDocroot(helpDir);
  44 
    matlab.internal.reference.SetReferenceRoot(helpDir);
  45 
    return;
< 0.001 
      1 
  46
end 
  47 

  48 
% Get the docroot.
< 0.001 
      1 
  49
if usejava('jvm') 
  0.001 
      1 
  50
    helpDir = strrep(char(com.mathworks.mlservices.MLHelpServices.getDocRoot), '/', filesep); 
  51 
else
  52 
    helpDir = fullfile(matlabroot,'help','');
< 0.001 
      1 
  53
end 

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