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

5 次查看(过去 30 天)
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 中查找有关 Lighting, Transparency, and Shading 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by