Matlab帮助,doc命令非常慢 [英] Matlab help, doc commands very slow

查看:95
本文介绍了Matlab帮助,doc命令非常慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I can't put my finger on why it's doing this, but since a few days help takes a lot of time to show. Either inline (selecting a function, selecting "help for"), or by using the commands doc or help. The command doc cmdname takes about 10 seconds to show the help window. I did, taking fwrite as example, try profile on;doc fwrite;profile viewer and digging through the rabbit hole I arrived on a private java matlab method which is taking forever:

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

Elapsed time is 9.993832 seconds.

任何想法都可能导致该问题吗?它也以安全模式发生,除MATLAB外没有其他正在运行的程序.我会尝试完全重新安装MATLAB,但是如果可以避免的话,那就太好了.

Any idea what could be causing that issue? It also happens in safe mode, with no other running programs than MATLAB. I'd try a complete reinstall of MATLAB, but if I could avoid that that'd be great.

推荐答案

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

The problem has been solved with input from mathworks support:

>> 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)

此后,以为临时文件被锁定是一个问题,我关闭了Matlab,进入AppData \ Local \ Temp \并清除了其中的所有临时文件.

After that, thinking it was a problem with a temp file being locked, I closed Matlab, went into AppData\Local\Temp\ and cleaned all the temporary files in it.

>> 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.

达到目的的要么是清除临时文件,要么是对内部Java类org.apache.lucene *的引用,但这确实是问题,现在doc又很快了.

Either it's the cleaning the temp files or the reference to internal java classes org.apache.lucene* that did the trick, but here it is, now doc is fast again.

这篇关于Matlab帮助,doc命令非常慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆