3 ms·
Indeed, the problem here is the type instability in the inner loop. There are a few optimization techniques that we intend to implement to deal with that but as
by KenoFischer 13y ago
Indeed, the problem here is the type instability in the inner loop. There are a few optimization techniques that we intend to implement to deal with that but as you noticed, we're not quite there yet.
- StefanKarpinski 13y agoThis isn't really a missing optimization, but an understandable mistranslation of the C code – the / operator with integer operands doesn't mean the same thing in Julia as it does in C. In C it means div whereas in Julia it does floating point division.
- KenoFischer 13y agoIt's both. Declaring the `::Int64`, doesn't magically turn it into integer division, but it does insert a convert(Int64,...), hence all the speedup here is obtained through type stability, even though the algorithm is still different.
- StefanKarpinski 13y agoRight, fair enough.