Surprisingly the most important change is to not access Properties.Settings.Default.importLineDashPattern thousands of times. The settings are stored in a list indexed by a string.
I have put the change into 3 separate commits that cover different aspects of the fix, so that you can decide which (if any) you want to include.
I have made the sorting work much faster by storing the index to the item with the shortest distance removing the need for a sort.
I improved the compare of properties, but the big factor here was not checking Properties.Settings.Default.importLineDashPattern more than necessary.
I have made the updating of the progress bar use less CPU. I don't think the function that decided if half a second had elapsed was working quite how you intended.
In your master branch there is currently an error that prevents it compiling. GCodeFromTeext.cs accesses Graphic.graphicInformation.OptionSortCode which doesn't exist. I deleted the line locally to perform my tests, but haven't checked in the change.
This is a solution for issue #347
Surprisingly the most important change is to not access Properties.Settings.Default.importLineDashPattern thousands of times. The settings are stored in a list indexed by a string.
I have put the change into 3 separate commits that cover different aspects of the fix, so that you can decide which (if any) you want to include.
I have made the sorting work much faster by storing the index to the item with the shortest distance removing the need for a sort.
I improved the compare of properties, but the big factor here was not checking Properties.Settings.Default.importLineDashPattern more than necessary.
I have made the updating of the progress bar use less CPU. I don't think the function that decided if half a second had elapsed was working quite how you intended.
In your master branch there is currently an error that prevents it compiling. GCodeFromTeext.cs accesses Graphic.graphicInformation.OptionSortCode which doesn't exist. I deleted the line locally to perform my tests, but haven't checked in the change.
Timings before were 24min16 and are now 1min47