What do you think was widely represented inaccurately so far? The worse performance of BigInt
was attributed to its allocations, which the issue you linked talks about. Speedup was stated to be sublinear even in ideal circumstances, and you corroborated that with your multithreading benchmark for BigInt
and the non-allocated Int
. On the facts, you’re just agreeing with us.
This is misleading. The difference is ~27x on my machine (between 1 and 2 orders of magnitude) even when the GC doesn’t run, and it’s accounted for by iszero
checking the BigInt
’s size
field rather than directly comparing its more complicated value to another integer it has to promote to another BigInt
first. The BigInt
instantiation takes most of the time, so the difference drops to ~2.4x if you preallocate BigInt(0)
prior to benchmarking ==
. Not really sure how that can improve further because that just ccall
s a GMP function.