Clipper2 slower than clipper1 #868
Replies: 3 comments 2 replies
-
Hi Sasha. Anyhow, I'm not entirely sure why Clipper2 is a little slower in this instance. I was initially presuming it was due to all the extra work Clipper2 does to ensure that "touching" polygons in clipping solutions are properly merged. (This was very incomplete in Clipper1). Unfortunately, disabling all this additional merging code doesn't seem to make much difference in Clipper2's performance. |
Beta Was this translation helpful? Give feedback.
-
On 17.05.24 г. 12:53 ч., Angus Johnson wrote:
...
Anyhow, I'm not entirely sure why Clipper2 is a little slower in this
instance. I was initially presuming it was due to all the extra work
Clipper2 does to ensure that "touching" polygons are properly merged.
(This was very incomplete in Clipper1). Unfortunately, disabling all
this additional merging code doesn't seem to make much difference in
Clipper2's performance.
Can you post example for disabling the merging?
thanks in advance,
Niki
|
Beta Was this translation helpful? Give feedback.
-
I achieved huge performance gains in a similiar case by subdividing the space and perfoming multiple unions recursively. |
Beta Was this translation helpful? Give feedback.
-
Hi there,
I've been using Clipper for generating GDS files, and recently I migrated my code from Clipper 1 to Clipper 2. However, I've noticed a significant decrease in performance for certain operations, especially union.
Interestingly, when I perform random operations, Clipper 2 shows much better performance compared to Clipper 1. However, when I try to generate a "grid cover," which essentially creates a grid with numerous repetitions of a square shape, the performance seems to degrade significantly (Clipper2 two times slower than Clipper1).
grid cover :
I've come across some discussions on this issue, but unfortunately, I haven't found a solution yet, even after trying optimization flags like -O3.
I'm hoping that the problem lies within my code and that there might be some optimizations that could be implemented to improve performance.
Any suggestions or insights would be greatly appreciated.
Clipper2 code :
Clipper 1 :
code of makePathsFromFile for Clipper2 :
/!\ I know the following codes are very inefficient but it doesn't matter i just did that for testing purpose
code of makePathsFromFile for Clipper1 :
And the data :
(Note that those Paths are not random it is real case scenario)
archiveCompressed.zip
Beta Was this translation helpful? Give feedback.
All reactions