BigInt is a wrapper around
The Spire library has a
SafeLong type with identical semantics, which specializes into two cases:
- an instance when the underlying number fits in a
- another instance that wraps
That would help tremendously the
BigInt performance profile when the underlying value is reasonable.
Spire is considering dropping
SafeLong in the future due to the induced triplication (
SafeLong); however, the optimizations
SafeLong provide could be ported to the Scala standard library.
It seems that source and binary compatibility could be completely preserved.
Would that contribution be appreciated? What would be the criteria used to decide whether the PR is merged?