Closed rburing closed 5 months ago
When compiling with -O2
the performance difference is gone:
$ ./clipper1-performance
Polygon size: 56
Time elapsed: 16 ms
$ ./clipper2-performance
Polygon size: 56
Time elapsed: 16 ms
:+1:
This is perhaps worth documenting.
I understand that the apparent timing lag in Clipper2 disappears when optimisations are enabled, but nevertheless ISTM that you're comparing apples with oranges. To make a fair comparison you need to use Clipper64 not ClipperD in your Clipper2 test. Using type double will cost you a little extra time because, internally in ClipperD, everything is cast to from double to int64_t then later back to double.
Hi, thanks a lot for this great library! I am working on integrating it into Godot:
Is it possible to change something about the Clipper2 program below (or the Clipper2 source code) to make repeated unions as fast as in Clipper1? Probably a big union should not be done like this, but I am trying to update the implementation of an existing API that only has a
union(A, B)
operation for two polygonsA
andB
.Clipper1 program:
Clipper2 program:
The two source files listed above together with a
Makefile
andtest_data.h
and the Clipper sources: clipper-performance.zipOutput: