-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cell.write
and Layout.write
are very slow on Windows if there are gigantic polygons in the cell
#1853
Comments
Thanks for bringing this up. I guess you are referring to the binaries on PyPI, right? These are made with MSVC while the standalong binary is made with gcc/MINGW. The problem could also be the STL implementation. The interesting part is that using the break function explicitly solves the problem. Basically, the writer uses a very similar function internally. Matthias |
Yes, correct, this is for the PyPi version (just tested it in the GUI, problem doesn't exist there). Sorry, should have mentioned that (still not used I assumed the writer would use something very similar (I assume essentially it's with different settings), therefore I tested it and brought it up here. Hope this makes the bug hunting and squashing a bit easier ;) Best, |
I suspect it is more an issue of the merge step that normalizes polygons with holes to simple polygons. This is a safety feature as non-merged polygons are likely to get spoiled by the splitting algorithm. |
Well ... looks like the std::deque implementation is more efficient on Linux. I tried to fix it, but the effect is the opposite. Now Linux is also slow :( ... but on the positive side, it is easier to debug on Linux. To be continued ... |
std::list::splice works miracles. Now Linux is 3x faster than before and Windows is comparable. Maybe slightly slower, but I can't check because I don't have identical machines to run comparisons. At least the script now executes in 1.7s in my (old i5) Windows box. |
Without further ado, here's a small test case
On Windows this is incredibly slow compared to Linux (tested on arch and debian) - 29+ sec vs 1.1 sec on linux
This also is the case for
ly.write
.Interestingly if the polygon is split with the new
break_
function first, it's similar speed on both platforms:I suspect write is getting compiled funnily on Windows and is doing something very inefficient that probably will not matter much if the polygon only needs splitting very few times for the GDS.
Initially discovered here gdsfactory/gdsfactory#3088
The text was updated successfully, but these errors were encountered: