Geometry_Engine: Stop checking for SelfIntersections when computing normal for curves? #2797
Labels
type:feature
New capability or enhancement
type:question
Ask for further details or start conversation
Description:
While doing some profiling on some of our heavier geometry methods such as the Boolean intersection/difference/union methods for polycurves/polylines it was found that the clear bottleneck in the execution of those methods was coming from the computation of the normal of the curves, and more specifically, the check if the curves where self intersecting.
for this case, this check is fundamentally redundant, and the method itself simply just raises a warning if the curve actually is self intersecting, but is only raising a warning.
Commenting this check out and re-running saw a performance boost of 80% (!!) for the test case I was running, which involved quite a lot of heavy operations, including computation of voronoi diagrams and similar, with time to compute going from 10 to 2 seconds by just this simple change.
Given this, I am tempted to remove this check from the method, alternatively add another method (something like UnsafeNormal or similar) that simply skips this check (and maybe some others) that can be called when the self intersection check simply is not required for the method to perform the way that is needed.
Glad to get any input on this.
@al-fisher @pawelbaran @FraserGreenroyd
The text was updated successfully, but these errors were encountered: