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

Bezier-rs: Use nonzero winding order for Poisson-disk insideness test #1590

Merged
merged 5 commits into from
Feb 4, 2024

Conversation

0HyperCube
Copy link
Member

I see ~20ms performance improvement but it may just be random error.

@Keavon
Copy link
Member

Keavon commented Jan 28, 2024

I just did a performance profiling to compare the speed of the build link above and dev (so both running with release optimizations) and I'm seeing an average of 200ms on dev and 250ms on release with the same artwork where I'm dragging around an anchor point. This also fits with my observations that the framerate felt higher on dev before I ran the profiler. So unfortunately this seems to slow it down, not speed it up as was hoped. Which is odd, since just by glancing at the code it does look like you generally simplified things and I'd expect it to run faster. Do you think there are any ways to further optimize this? mI also wonder why my test with a ~50ms performance drop is in the opposite direction of your observed ~20ms perf improvement.

@0HyperCube
Copy link
Member Author

image
Dev is broken anyways.

@Keavon
Copy link
Member

Keavon commented Jan 28, 2024

That one point coming out on the left side of your image appears to be a "lucky" rare point that passes the two-direction check. I never managed to run into that during my tests but it's, of course, a possibility as you just found. I suppose it's now just a question of whether we want to trade performance for correctness (or, if we can figure out why it was faster on your machine but slower on mine and fix it for all, that'd be even better).

@Keavon
Copy link
Member

Keavon commented Feb 4, 2024

With your updates, it looks like my new test has this going from 700ms per frame (on master) down to 650ms per frame (in this branch), so your optimizations helped make this a net positive! And the switch to the nonzero fill rule is also appreciated since that lets us match the SVG default. Thanks for sticking with this and finding ways to make it even faster!

Copy link
Member

@Keavon Keavon left a comment

Choose a reason for hiding this comment

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

💯

@Keavon Keavon changed the title Proper winding order for poisson distribution Bezier-rs: Use nonzero winding order for Poisson-disk insideness test Feb 4, 2024
@Keavon Keavon enabled auto-merge (squash) February 4, 2024 05:58
@Keavon Keavon merged commit 5f72a6a into master Feb 4, 2024
2 checks passed
@Keavon Keavon deleted the proper-winding-order branch February 4, 2024 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants