3 ms·
They’re also much more expensive in memory, because you have to separately allocate anything you don’t know the size of. Something being O(N) can also be a sec
by astrange 4y ago
They’re also much more expensive in memory, because you have to separately allocate anything you don’t know the size of.
Something being O(N) can also be a security issue since it introduces a timing side channel.
I don’t think I’ve ever needed a bignum in my life or even a 64-bit integer (excluding pointers and file sizes). Of course I’ve used them inside black box crypto libraries but they have to be careful with them because of said security issues.
- pfdietz 4y agoAs implemented in lisps they typically don't use more memory than 64 bit longs. That's because fixnums (typically 61 bit signed values) are unboxed, existing in the "pointer" itself; only when numbers fall outside that range do they become bignums that must be heap allocated (and in practice almost all integers are fixnums.)