Closed rgankema closed 3 years ago
You make a good point. Benchmarking results were on Julia v1.1, on v1.5 they still hold but there were regressions with v1.3, 1.4 independent of SaferIntegers that slowed down the performance. These are micro-benchmarks rather than vector oriented. I will investigate.
Working with sum
and summing Ints vs summing SafeInts, I find these results to be reasonable.
I am not convinced that mucking with the currently correct logic is worth saving a factor of 2 here.
There is a possibility that I can apply SIMD.jl to these sums -- I will let you know.
n | rel time |
---|---|
10 | 1.2 |
100 | 5 |
1_000 | 6.5 |
10_000 | 5 |
100_000 | 3.25 |
1_000_000 | 2.75 |
SIMD is not a good solution here.
The benchmark in the readme suggest a fairly low overhead for using
SafeInt
s, but unfortunately I'm seeing a much larger performance gap (almost an order of magnitude) for summing a simple vector of integers. Am I doing something wrong?