Skip to content
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

Rework Mask module #2130

Merged
merged 7 commits into from
Jul 6, 2021
Merged

Rework Mask module #2130

merged 7 commits into from
Jul 6, 2021

Conversation

rowanwins
Copy link
Member

@rowanwins rowanwins commented Jun 26, 2021

This PR reworks the mask module to be much simpler.

It's a bit slower on some of the tests (like surprisingly so) although I haven't quite dug into why deeply, it's most likely something to do with the union operation being called when it probably doesn't need to be.

This work was originally included in my v7 branch.

Resolves #1944
Resolves #1917
Resolves #2054
Resolves #1454

Before

basic x 2,037 ops/sec ±1.93% (85 runs sampled)
mask-outside x 1,652 ops/sec ±1.99% (86 runs sampled)
multi-polygon x 4,630 ops/sec ±2.89% (81 runs sampled)
overlapping x 12,926 ops/sec ±1.76% (93 runs sampled)

After

basic x 4,627 ops/sec ±25.23% (21 runs sampled)
mask-outside x 3,892 ops/sec ±34.80% (15 runs sampled)
multi-polygon x 5,837 ops/sec ±3.03% (91 runs sampled)
overlapping x 22,326 ops/sec ±1.34% (90 runs sampled)

@rowanwins rowanwins changed the title rework dissolve Rework Mask module Jun 26, 2021
Copy link
Collaborator

@mfedderly mfedderly left a comment

Choose a reason for hiding this comment

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

lgtm. Its a little weird that the meat of this lives in another repo. It introduces this issue where polygon-clipping depends on turf which depends on polygon-clipping, and that has the turf deps pinned at 5.x which is not great, but we already depended on this exactly polygon-clipping apparently so it isn't making things worse.

// basic x 4,627 ops/sec ±25.23% (21 runs sampled)
// mask-outside x 3,892 ops/sec ±34.80% (15 runs sampled)
// multi-polygon x 5,837 ops/sec ±3.03% (91 runs sampled)
// overlapping x 22,326 ops/sec ±1.34% (90 runs sampled)
Copy link
Collaborator

Choose a reason for hiding this comment

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

🥇 I AM SPEED

@mfedderly
Copy link
Collaborator

turf deps pinned at 5.x

Huh this is actually just devDependencies so we're good. There was another package somewhere that had the old turf libraries as actual dependencies.

@mfedderly mfedderly merged commit 4a0ff38 into master Jul 6, 2021
@mfedderly mfedderly deleted the mask-again branch July 6, 2021 23:18
@3zzy
Copy link

3zzy commented Jul 6, 2021

@mfedderly Thanks, finally! Just wondering if there's going to be a an actual release anytime soon?

@mfedderly
Copy link
Collaborator

I'm probably not going to get to it in the next few weeks but maybe @rowanwins has some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants