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

Use JTS doubledouble implementation instead of ttmath #303

Merged
merged 10 commits into from
Apr 16, 2020

Conversation

pramsey
Copy link
Member

@pramsey pramsey commented Apr 15, 2020

The ttmath library is quite large and full of fancy stuff like ASM and so on, and all we seem to need is doubledouble. Also ttmath has some issues on big-endian systems. Also, this implementation seems to be 5-10% faster than ttmath, and I haven't exactly fine tuned it. I think with some added unit tests from JTS we should consider dropping ttmath entirely, and maybe even back-porting this into 3.8, since there is no regression change at all (!!). (Maybe, at least so far testing only on my machine.)

static DD pow(const DD &d, int exp);
static DD trunc(const DD &d);

bool isNaN() const;
Copy link
Member

Choose a reason for hiding this comment

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

Many of these methods seem like good candidates for inlining (either by defining them where they're declared, or by using a .inl file like much of the older work)

Copy link
Member Author

Choose a reason for hiding this comment

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

Mostly they don't get called except in the tests. Most of the work happens in the arithmetic operators and selfAdd/selfMultiply.

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like just about all the methods should be inlineable, no? Would be interesting to see the performance diff.

include/geos/math/DD.h Outdated Show resolved Hide resolved
@pramsey pramsey merged commit d11fa1f into libgeos:master Apr 16, 2020
@pramsey pramsey deleted the master-dd branch April 16, 2020 22:33
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

3 participants