Skip to content

Performance issues as number of vertices increases for intersection operations #1037

@olly-writes-code

Description

@olly-writes-code

Hi @AngusJohnson! Thanks for the wonderful library.

I've been hacking away on some python bindings at pyclipper2.

All the time I'm comparing vs shapely which is my go-to for geometric operations. I came across Clipper while reading the FreeCAD forums so I wanted to give it a go.

I did some benchmarking. For small geometries I see that Clipper2 is roughly 5x faster than shapely but as the number of vertices for the intersecting geomtries (or paths) increases the performance drops off. Here's a chart with some increasing complicated shapes (50 -> 1000 vertices) interesecting a circle.

It seems strange to me that performance degrades so substantially around the 250 vertices mark. Any initial thoughts? Anything I can do to help uncover what might be going on here?

Image

Thanks again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions