フィルターのクリア

slow which() to locate functions after Ubuntu OS upgrade

1 回表示 (過去 30 日間)
Geoff Stanley
Geoff Stanley 2020 年 7 月 30 日
After upgrading from (X)Ubuntu 18.04 to Xubuntu 20.04, the which() function has become way slower.
tic
for rep = 1 : 100
which('myfcn'); % could exist, or not
end
toc
This takes about 1.2 seconds. Not huge, since I only realistically call which() a few times, but I noticed this when benchmarking a function against problem-size. Before the upgrade, a problem of size n took time O(n) so long as n >= 1000, roughly. After the upgrade, the time was O(1), i.e. constant and insensitive to n, and only O(n) after n >= 16000, roughly. That is, which() became the bottleneck for small problems.
I'm on a Thinkpad P1. The MATLAB path is not abnormally large; actually, I removed some things during the upgrade, so it's smaller than before. I've also tried to restoredefaultpath() which shaves 0.3 sec off the above 1.2 sec figure. Using rehash didn't change the results. I upgraded to R2020a simultaneously, but I subsequently re-installed R2019a (which I was using before) and it's the same speed.
Any ideas on how to investigate this further? Thanks.

回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by