← All bug reports

FS#1662Select > Select Contour: slow for complex drawings

Type
Performance Issue
Status
Closed
Resolution
Implemented
Category
QCAD (main)
Severity
Low
Priority
Low
Reported version
3.19.1
Operating system
All
Reported
2017-11-17 by unknown-error
Closed
2017-11-17 by andrew

Hi!

when working with files containing many not connected elements (non-poly-line elements) a double click can cause a coffee-break easily. The search for connected entities easily takes over 5 minutes on an up to date machine ([email protected]) with files that are pretty standard in size (2 or 3 MB file size ascii dxf). Adding an interruption-method would be suitable (for example by pressing escape).

attached a file with a polyline of 13000 entities and a second file with just everything duplicated. When exploding the polyline and double clicking an element it takes quite a while until all elements are selected. (this is not an extreme example, I had sometimes 10 minutes of waiting with slightly bigger files, accidently double clicking something).

also an improved algorithm for the search would help to speed up the selection. (e.g. divide the area in smaller parts, do the search there, or an option to search only in the visible view port of the document)

Martin

Comments (3)

andrew 2017-11-17

I got this down to about 18s by avoiding recursive calls and choosing different data structures for the algorithm.

A cancel button is not as easy to implement as it might sound. Keeping the GUI responsive slows things further down and also potentially lets the user do other things which could lead to a crash.

andrew 2017-11-17

If you sometimes accidentally double-click a contour, you could disable this feature under:
Edit > Application Preferences > Graphics View > Behaviour

You can still select contours using Select > Select Contour

unknown-error 2017-11-18

actually I make heavy use of the double click select, so disabling is not an option for me - just sometimes I'm clicking on the "wrong end of a curve" and then it's coffee break. Most of the time I just want to select 10 or 20 connected elements after rounding or trimming some curves to do some clean up (and not selecting the entire drawing). Probably other users have different intentions.

what about an optional dialog popping up after 10 seconds if the command has not completed (or a user specified limit of elements that has been worked through without completing the function). So no gui interaction is possible except when that dialog shows up, giving you yes (continue) or no (cancel) or something like that. Same applies for some other computation heavy commands.

kind regards
Martin