laggy issue of code editor in R2018b

조회 수: 21 (최근 30일)
Yan Zhang
Yan Zhang 2018년 9월 30일
댓글: Jonas Hofbauer 2022년 4월 23일
I am using Macbook Pro 2014. 2.6Ghz i5 processor, 8GM 1600Mhz memory. I installed two versions of matlab, 2015a and 2018b. When I edited my codes in 2015a, everything is fine. However, running 2018b on the same machine, the code editor is very laggy. By "laggy", I mean when I simply tried to move the cursor or type some texts, it may respond after 1-2 seconds. Sometimes, the left bottom corner popped out info "processing...". I didn't see this info in the previous matlab version. Is the new version running something new in the back to cause this laggy issue? Am I the only one having this problem?
  댓글 수: 3
Josh Parks
Josh Parks 2018년 10월 1일
I'm having the same issue with a MacBook Pro 2015. 2018a has no issues
Yan Zhang
Yan Zhang 2018년 10월 2일
Thanks,guys! Someone tested it on macbook pro 2018 and it was fine there. I guess I'll simply go back to R2018a.

댓글을 달려면 로그인하십시오.

답변 (4개)

Kris Fedorenko
Kris Fedorenko 2018년 10월 3일
편집: Kris Fedorenko 2018년 10월 3일
There were instances of similar behavior in R2018b caused by the Magnet app. Turning it off should resolve the issue. Alternatively, you should be able to use keyboard shortcuts with no delays.
  댓글 수: 8
Josh Carlile
Josh Carlile 2021년 1월 19일
Quitting magnet solved the problem. Fantastic find!
I haven't seen any way to opt-out Matlab from Magnet but if anyone has suggestions please share
Jonas Hofbauer
Jonas Hofbauer 2022년 4월 23일
When Matlab is open, you can go into the Magnet settings via the menu-bar dropdown and tick "Igonre Matlab" – resolved the issue for me!

댓글을 달려면 로그인하십시오.


Fan Zhang
Fan Zhang 2019년 6월 27일
I encoutered the same problem on both r2018b and r2019a. The solution is to turn off Magnet.
Hope it helps.

Daniel Pantea
Daniel Pantea 2018년 10월 22일
편집: Daniel Pantea 2018년 10월 22일
Seems not only MAC is affected. I have same delays in Windows 7 x64. Tested same script and: - with R2018b it needed 23.4s to process the data. - with R2018a it needed 17.21s to process the same data. I have to go back to R2018a as in some situations the display gets unresponsive for seconds with R2018b! Hope they come with some patches, else this is a step back...
  댓글 수: 5
Yan Zhang
Yan Zhang 2018년 10월 22일
Thanks, Daniel, for this very detailed test! Apparently there are other people having this issue. Below is another related post:
https://www.mathworks.com/matlabcentral/answers/421446-r2018b-runs-very-slow-on-macos-10-14?s_tid=answers_rc1-2_p2_BOTH
I didn't get to test the running time for some script because the laggy issue of typing text in the script already stops me from doing that. Some people solve the problem by turning of the Magnet app. But some people have the same issue when they are not window splitting app installed. Hope they can come up with a fix.
Daniel Pantea
Daniel Pantea 2018년 10월 25일
I got great help from support and they identified a place of optimization which reduced the consumed time about 10 times! Details are below and after that the elapsed time difference from 2018b vs 2018a was insignificant:
  • 17a: 1.931015 seconds.
  • 18a: 2.253766 seconds.
  • 18b: 2.268560 seconds.
Here's detail of the improvement (which are specific to my case) I received from support:
Around line 775 in the SCRIPT.m, there is a very tight loop:
for i = 1:N1
k = min(i, mean_len);
my_mean = (my_mean*(k-1)+hUI.preprocessed{1}{ch}(i)) / k;
hUI.preprocessed{3}{ch}(i) = my_mean;
end
Using temporary variables to hoist some of the indexing out of the loop will make a huge difference:
tempVar3 = hUI.preprocessed{3}{ch};
tempVar1 = hUI.preprocessed{1}{ch};
for i = 1:N1
k = min(i, mean_len);
my_mean = (my_mean*(k-1)+tempVar1(i)) / k;
tempVar3(i) = my_mean;
end
hUI.preprocessed{3}{ch} = tempVar3;

댓글을 달려면 로그인하십시오.


Yan Zhang
Yan Zhang 2019년 1월 23일
For anyone who is still interested, I updated my OS to Mojave (10.14.2) and the laggy issue of R2018b disappears.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by