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

BigInt should use special-case binary operations rather than promotion rules #2839

Closed
stevengj opened this issue Apr 11, 2013 · 1 comment
Closed
Labels
performance Must go faster

Comments

@stevengj
Copy link
Member

Currently, bigint.jl only defines binary operations (+, *, etc.) on pairs of BigInt values, and uses promote_rule{T<:Integer}(::Type{BigInt}, ::Type{T}) = BigInt for mixed operations.

However, GMP provides special functions mpz_add_ui etcetera to perform binary operations on a BigInt and a Culong or Clong, which are presumably much more efficient than converting the Clong into a BigInt first and then performing the operations (though I haven't benchmarked them). We should exploit these.

@JeffBezanson
Copy link
Member

Fixed by merging #2814.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster
Projects
None yet
Development

No branches or pull requests

2 participants