JuliaPerf / BenchmarksGame.jl

Other
43 stars 13 forks source link

faster pidigits #28

Closed maltezfaria closed 5 years ago

maltezfaria commented 5 years ago

a faster version of pidigits based on the C and C++ codes. Not very idiomatic since I had to wrap some GMP functions in order to avoid too many allocations when doing operations with BigInt...

maltezfaria commented 5 years ago

I would be interested to know if there is a better way to do things like add!(x,y) in a more "julian" way when x and y are BigInt. Something like x += y, for example, could call add!(x,y) instead of the current call which creates a new BigInt for the addition, and then binds it to x (I think).

KristofferC commented 5 years ago

x += y gets lowered to x = x + y so there is no way to do these differently.