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

Further optimise int/float comparison #2188

Merged
merged 9 commits into from May 17, 2018

Conversation

scoder
Copy link
Contributor

@scoder scoder commented Mar 29, 2018

By accident, the existing special int object handling code was not used when the result of a comparison was already known to be of type bint (instead of a Python object), nor for the "!=" operator.

It now has a dedicated implementation for (in-)equality.

@scoder scoder changed the title The optimised int/float comparison was accidentally not activated in many cases Further optimise int/float comparison Mar 30, 2018
@scoder scoder force-pushed the faster_int_comparison branch 2 times, most recently from 0014a8c to 31f7c9c Compare April 1, 2018 07:45
@scoder scoder force-pushed the faster_int_comparison branch 3 times, most recently from 7f74cd6 to 8f6f7c8 Compare April 8, 2018 14:46
…n the result of a comparison was already known to be of type bint (instead of a Python object), nor for the "!=" operator.

These seem to be fairly common cases.
…tion that minimises branching and comparisons.
…ong digits that fit into a long completely and LONG_MAX.
@scoder scoder merged commit b74716a into cython:master May 17, 2018
@scoder scoder deleted the faster_int_comparison branch May 17, 2018 05:04
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

1 participant