I tested removing the allocation of mpz_t and reusing the old cell in abs (which is wrong, I know, it's just for understanding the impact), and the code ran 10x faster.
So maybe we could have a bignum pool?
i don't know if what is costly is allocating, initializing, or both... But we could try.
I tested removing the allocation of
mpz_tand reusing the old cell inabs(which is wrong, I know, it's just for understanding the impact), and the code ran 10x faster.So maybe we could have a bignum pool?
i don't know if what is costly is allocating, initializing, or both... But we could try.