JeffreySarnoff / SaferIntegers.jl

These integer types use checked arithmetic, otherwise they are as system types.
MIT License
59 stars 10 forks source link

Outdated timing? #23

Closed PallHaraldsson closed 2 years ago

PallHaraldsson commented 3 years ago

"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

JeffreySarnoff commented 3 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.

JeffreySarnoff commented 2 years ago

Revisiting this -- the source code is mirroring Julia Base in terms of selecting the specific wordsize given Int/UInt.