Closed PallHaraldsson closed 2 years ago
While SafeInt32 is tighter than SafeInt64, SafeInt64 does not overflow as easily.
I will retest the overhead as I look to simplify dispatch.
Revisiting this -- the source code is mirroring Julia Base in terms of selecting the specific wordsize given Int/UInt.
"On one machine, the overhead relative to the built-in integer types is <= 1.2x."
Should people default to SafeInt32 (it's understandable people often avoid Int64, just out of fear)? It should be faster than 64-bit Int (for memory bandwidth reasons, rather than faster check)? I see why you want to keep "compatibility", but maybe reconsider:
https://github.com/JeffreySarnoff/SaferIntegers.jl/blob/823b3312e5de66f3870ffa3ecee60ec3cfd53e21/src/type.jl#L17