uiprogressdlg slows down application

4 Ansichten (letzte 30 Tage)
Øyvind Rørtveit
Øyvind Rørtveit am 17 Apr. 2020
Bearbeitet: Øyvind Rørtveit am 17 Apr. 2020
I have a problem with uiprogressdlg showing the progress in my application. It seems the animation in the progress dialog slows down the application significantly. Timing my process, it takes almost twice as long when I show the dialog. It is not updating the dialog that is causing this, because doesn't matter whether I actually update the dialog, the slowdown will occur as long as the progressbar is showing with any percentage except for 0 an 100. If the dialog shows a constant 0 and 100 %, there is no animation, and then the slowdown does not occur., so that is why I figured the reason for the slowdown is the animation of the progress bar.
Example:
f = uifigure;
d = uiprogressdlg(f, 'Title', 'Demo');
d.Value = 0.9;
k = 1.01;
tic
for i = 1:3e+10
k = k*k;
end
toc
close(d);
close(f);
>> Elapsed time is 41.731683 seconds
Change the d.Value line to 0.0, I get
>>Elapsed time is 35.611704 seconds.
In my actual application, the difference is much more dramatic. May be because I am running parallel processing (but not when the progressbar is being updated).
Is there any workaround for this?

Antworten (0)

Kategorien

Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange

Produkte


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by