← Back to team overview

kicad-developers team mailing list archive

OS X default canvas graphics performance

 

Hi,

as already mentioned in another thread I had to create some new footprints recently and I noticed that footprint editor is horribly slow.
I have 2 machines, one is running OS X 10.10 with a 1920x1080 display and the other is a MacBook Pro Retina with 10.11.
Test case is: Create an empty new footprint, then zoom in/out. 
On the MacBook zoom change can take >2s, on the other machine it is snappy as usual (for the default canvas).

I profiled this and it seems that on the MacBook the culprit is the GRDashedLine used to draw the x/y axis… according to Instruments drawing the dashed line eats up >80% of time in the simple above test case, which sums up to 30s CPU time zooming in/out maybe 10 times.
Obviously, something in the dashed-line drawing code of wxWidgets is not right.
So, I removed the dashed pen in GRDashedLine to test and voila… runs without performance problems on the MacBook.

There are two weird things about that:
(1) In footprint editor I didn’t ever see that the axis are dashed lines (on both machines). They are solid lines even zoomed in to the maximum. I have no idea why it shows as solid lines.
(2) The only other place where dashed lines are used is in eeschema. There, they seem work without any performance problems and they even show up as dashed lines.

Workaround is easy, but what is preferred:
(a) Change GRDashedLine to used solid pen for OS X. 
==> In eeschema you would get a solid instead of a dashed line now, which would not be in line with the toolbar icon. No visual change for footprint editor, since it wasn’t dashed before either…
(b) Replace GRDashedLine by GRLine in EDA_DRAW_PANEL::DrawBackGround() only for OS X
==> No impact on eeschema
(c)  All other canvases at least on OS X also don’t show the axis as a dashed but a solid line. 
==> Like (b) but a change for every platform.

Any preferences?


Regards,
Bernhard



Follow ups