Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[earcut] Drop smallest inner rings for earcut performance #5145

Closed
wants to merge 0 commits into from

Conversation

yhahn
Copy link
Member

@yhahn yhahn commented May 25, 2016

Port of JS version + unit tests: mapbox/mapbox-gl-js#2622

cc @jfirebaugh @mourner @jakepruitt

for (const auto& polygon : classifyRings(geometry)) {
// Max number of rings to allow per polygon.
// Optimizes polygons with many interior rings for earcut tesselation.
unsigned maxRings = 500;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jfirebaugh not sure where the right place for this is.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use uint32_t type instead of unsigned everywhere — it's more predictable across platforms.

@mourner
Copy link
Member

mourner commented May 26, 2016

Similar to my JS PR comment, we should use std::nth_element instead of std::sort here for performance and convenience.

@jfirebaugh
Copy link
Contributor

Going to fix the above issues and merge this into the earcut branch.

@jfirebaugh jfirebaugh closed this May 27, 2016
@jfirebaugh jfirebaugh deleted the earcut-ringsort branch May 27, 2016 18:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants