Here's my early draft of C rewrite/port #137
alexisnaveros
started this conversation in
General
Replies: 1 comment
-
Alexis, the clipper2c.h file is missing from your site (and isn't in the Wayback machine). Also could you give an example of using your port from C please? I'm having a hard time mapping the calls to the calls described in the Clipper2 documentation. By the way, in cchybridsort.h
on hardware that supports 64 bit ints but uses 32 bit pointers and 32 bit size_t, the original 'v >>= 32' caused a compiler warning (even though the code will never be executed) - which using the cast above avoids. Other than that it was a remarkably clean compilation. I threw together a fairly basic Makefile:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hey people, here's an early version of my C rewrite/port of Clipper2. The API looks like this:
http://www.rayforce.net/clipper2c/clipper2c.h
And the rest of the code can be found here:
http://www.rayforce.net/clipper2c/
Results are identical to Clipper2's on July 9th... (okay, it seems some bugs have been fixed since that date, I need to check them out).
Based on one random test, this preliminary C version appears to be 6% faster than the C++ version?... I have reversed a couple experimental optimizations to maintain the code's structure closer to Clipper2, for now. I'll wait a bit for bug fixes and/or the outcome of scalability experiments (it's going to be messy if the code is completely transformed).
(ideally compile with -O3 -flto -march=native -mtune=native, or at least -msse4.1 -msse4.2, some optimizations are based on SSE 4.1/4.2 intrinsics)
Beta Was this translation helpful? Give feedback.
All reactions