필터 지우기
필터 지우기

Performance of uitable() within a uifigure() compared to the performance within a figure()

조회 수: 20 (최근 30일)
Currently I am trying to figure out why the performance of uitable() within a uifigure() is so bad, that it is not useable at all. I hope somebody can direct me in direction here.
Basically I just have a uitable() within a uifigure() and fill the table with a 2000x100 mat of numbers. The uitable becomes unuseable. If you scroll it lags like hell until it is all rendered again. If you select a cell it also lags until the cell selection is shown.
If you create a uitable() within a figure() and fill it with the same amount of data there are no problems at all. It is super responsive as it should be.
Here are two coding examples for a uitable() in a uifigure() and a uitable() in a figure().
Please let me know if I am missing anything here because the new uifigure() approach seems to be unuseable.
%% uifigure() test
% this table will lag while scrolling and clicking cells
% Create and stack magic data
data = magic(100);
data = repmat(data, 20, 1);
% create figure
f = uifigure('Name', 'Test');
% create a 1x1 layout
g = uigridlayout(f);
g.RowHeight = {'1x'};
g.ColumnWidth = {'1x'};
% create table
dataTable = uitable(g);
% add data to table
dataTable.Data = data;
%% figure() test
% this table can be used without any lag
% Create and stack magic data
data = magic(100);
data = repmat(data, 20, 1);
% create figure
f = figure('Name', 'Test');
% create table
dataTable = uitable(f);
% add data to table
dataTable.Data = data;
  댓글 수: 8
Bruno Luong
Bruno Luong 2023년 1월 23일
편집: Bruno Luong 2023년 1월 23일
The performance issue is related to HG2 engine and technology behind it. It manifests in various forms since it appears in R2015, TMW improves it but it won't catch the HG1 anytime soon. It won't be solved in the next release IMO. Either it's acceptable for you either you would stay with the old system, like me.
What I find intestering and somewhat puzzeling in your question is that the container uifigure matters, and not really the uitable itself.
Thomas Kötter
Thomas Kötter 2023년 1월 23일
I understand it like this (but I am not a professional in this topic):
figure() and uifigure() are working on a completly different framework underneath. If you use uitable() it automatically detects the type of figure/uifigure. If you use figure() as top parent it will spawn the oldschool, fast, reliable table. If you used uifigure() as top parent the new fancy but slow table will be created. The command is the same but it checks its top parent and does something totally different depending on that.
But I think you guys know way more about this than I do :) Thanks for the help.
Now we know that we can postpone our switch from figure() to uifigure() for quite some time. We maintain and develop a plattform which hosts several tools and has a pretty fancy gui. If we switch now this would not work at all since everything is way too slow with the new system.

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

답변 (1개)

Shuba Nandini
Shuba Nandini 2023년 3월 31일
Hello,
I understand that you are facing problem with “uifigure” function, but this is a known issue, and my colleagues are already working on this and it might get fixed in the future release.
I hope this helps!
Regards,
Nandini

카테고리

Help CenterFile Exchange에서 Develop uifigure-Based Apps에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by