matlab帮助,doc命令很慢

rie*_*efr 5 matlab

我无法理解为什么会这样做,但是因为几天的帮助需要花费很多时间来展示.内联(选择功能,选择"帮助"),或使用命令dochelp.该命令doc cmdname大约需要10秒钟才能显示帮助窗口.我做了,fwrite举个例子,尝试profile on;doc fwrite;profile viewer挖掘兔子洞,我到达了私有的java matlab方法,这是永远的:

tic;
com.mathworks.mlwidgets.help.HelpUtils.getDocCommandArg('matlab\fwrite', true);
toc 

Elapsed time is 9.993832 seconds.
Run Code Online (Sandbox Code Playgroud)

知道是什么导致了这个问题吗?它也发生在安全模式下,没有其他运行程序而不是MATLAB.我会尝试完全重新安装MATLAB,但如果我能避免这样那就太好了.

rie*_*efr 1

通过 mathworks 支持的输入,该问题已得到解决:

>> tic;doc fwrite;toc
Elapsed time is 20.301202 seconds.

>> tic;reader = org.apache.lucene.index.IndexReader.open(fullfile(docroot,'helpsearch'));
searcher = org.apache.lucene.search.IndexSearcher(reader);
term = org.apache.lucene.index.Term('relpath','ref/plot.html');
query = org.apache.lucene.search.TermQuery(term);
hits = searcher.search(query);
fprintf('Found %d results\n', hits.length); searcher.close; reader.close; toc;
Java exception occurred:
java.io.IOException: Lock obtain timed out:
Lock@C:\Users\b\AppData\Local\Temp\lucene-ca3070c312bc20732565936b371a8bd3-     commit.lock
at
org.apache.lucene.store.Lock.obtain(Lock.java:56)
at
org.apache.lucene.store.Lock$With.run(Lock.java:98)
at
org.apache.lucene.index.IndexReader.open(IndexReader.java:141)
at
org.apache.lucene.index.IndexReader.open(IndexReader.java:125)
Run Code Online (Sandbox Code Playgroud)

之后,我认为是临时文件被锁定的问题,关闭了Matlab,进入AppData\Local\Temp\并清理了其中的所有临时文件。

>> tic;
reader = org.apache.lucene.index.IndexReader.open(fullfile(docroot,'helpsearch'));
searcher = org.apache.lucene.search.IndexSearcher(reader);
term = org.apache.lucene.index.Term('relpath','ref/plot.html');
query = org.apache.lucene.search.TermQuery(term);
hits = searcher.search(query);
fprintf('Found %d results\n', hits.length); searcher.close; reader.close; toc;
Found 5 results
Elapsed time is 0.106868 seconds.

>> tic;doc fwrite;toc
Elapsed time is 0.153808 seconds.
Run Code Online (Sandbox Code Playgroud)

要么是清理临时文件,要么是对内部 java 类 org.apache.lucene* 的引用达到了目的,但现在 doc 又快了。