On Sun, Apr 21, 2013 at 03:48:06PM +0000, Solonen Vesa wrote: > While investigating the Pcbnew drawing performance problems it became evident > that quite a lot of time is spent calculating distances. The attached logs > were captured by Pauli Sundberg while zooming in and out the video demo > board. He also suggested using squared distances (d^2 = a^2 + b^2) for DRC > calculations as that would save expensive square roots [1].
When comparing distances, yes, that would be a good idea, it's a common trick (IIRC it's already done that way during track editing). That aside, for what reason should be pcbnew computing distances during redraw? Shouldn't a bounding box check suffice for drawing purposes? With *a lot* of track and a big board some kind of spatial index would be useful maybe (something like an r-tree) but it's not exactly trivial to build (and maintain). The video demo board is only moderately busy (8500 track segments and 2000 pads): in fact I can't see performance issues even with an atom core:P It's interesting work anyway, I'll give a look to these logs. -- Lorenzo Marcantonio Logos Srl _______________________________________________ Mailing list: https://launchpad.net/~kicad-developers Post to : [email protected] Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp

