heitzmann / gdspy

Python module for creating GDSII stream files, usually CAD layouts.
Boost Software License 1.0
348 stars 126 forks source link

speed improvement in remove_polygons #201

Closed tvt173 closed 2 years ago

tvt173 commented 2 years ago

Removal of an item from a list at an arbitrary index in python is an O(N) operation. Repeatedly doing this over a list can be very costly, as is done in the current remove_polygons() function. This MR instead filters the existing list into a new list via a list comprehension, which is much faster in scenarios where there are many polygons to remove.

heitzmann commented 2 years ago

Looks good, thanks!

tvt173 commented 2 years ago

thanks @heitzmann! looking forward to the next release with this patch. i see orders of magnitude speed improvement in development

tvt173 commented 2 years ago

hi @heitzmann , would it be possible to get a new release with this patch?

heitzmann commented 2 years ago

Sure!

tvt173 commented 2 years ago

thanks Lucas! -- obrigado

tvt173 commented 2 years ago

(conda too please!)