Why is the rectangle command so much slower on the new graphics engine?

조회 수: 5 (최근 30일)
Johannes Korsawe
Johannes Korsawe 2016년 4월 28일
답변: Walter Roberson 2016년 4월 28일
Hi folks,
i am just comparing the performance in plotting a lot of filled circles via the rectangle command. My benchmark is Release 2010b and i want to switch to Release 2015b.
I could not believe that i found 2015b being 5 times slower! Same machine, same renderer. (Doesn't depend on the renderer, though.)
Here is my example code including time measurement.
z=0;
for exp=1:0.2:5,
n=round(10^exp);cntr=rand(n,2);rad=rand(n,1);z=z+1;figure;hold on;set(gcf,'Renderer','opengl');
t1=clock;
for i=1:n,
h=rectangle('Position',[cntr(i,1)-rad(i),cntr(i,2)-rad(i),2*rad(i),2*rad(i)],'Curvature',[1,1],'FaceColor','b','EdgeColor','none');
end
t2=clock;result(z)=etime(t2,t1);nn(z)=n;delete(gcf);
end
Who has an idea to draw so many filled(!) circles (patches or anything, not pure lines as in viscircles) at a competetive speed also in 2015b?
For a major application of mine this really is a big drawback!

답변 (1개)

Walter Roberson
Walter Roberson 2016년 4월 28일

카테고리

Help CenterFile Exchange에서 Polygons에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by