-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Improve Clipping Polygon Performance #12258
Comments
Also reported in #11750 (comment) |
Certain aspects of the polygon shape may have an additional impact here. (For example, a polygon with 100 points that covers a pole and the IDL may have a larger impact than one that does not). But the performance hit is definitely correlated with the number of polygon points. I created a sandcastle where you can crank up the number of polygon points from 4 to 500 (and it's a circle - i.e. as convex as it can be). And one can clearly see the performance hit: The sandcastle: Looking at a performance trace reveals (some of) the (potential) culprit(s): Apparently, computing that rectangle for the clipping polygon takes a lot of time. There are a few places where one could consider performance improvements. Computing this rectangle in each and every frame is certainly wasteful: I think that the As an experiment, I just created a (hacky!!!) branch that just caches this rectangle, based on the (Yeah, storing the The main point of this experiment is shown at the end of the GIF above: When using the check box to set that Maybe there's a "good" way to avoid recomputing that rectangle in each frame... |
Feature
#11750 added an initial implementation of clipping polygons. However, some users are seeing performance hits depending on usage.
The performance hit is not directly correlated with the number of polygon positions. The geographic extent, concavity, and number of polygons also factor in. For example, the AEC Clipping Example is a particularly concave polygon with many positions shows this performance hit.
The text was updated successfully, but these errors were encountered: