Closed DoubleHyphen closed 3 years ago
Looks great again! I will have a look soon. Very handy
I did checkout the code and get it running adding the num_traits
dependency. Sad that something like num_traits
is not part of rust std
.
I now observe a further performance gain dropping from 600 ms to about 180 ms so this is now more in the performance range that you experienced. But were does this 3 times speedup come from? Looking at the code I don't really get it?
OK, so this was way more difficult than I thought, and the code's become a bit uglier as a result. Nonetheless, the functions now ought to function not just for
u32
s as before but also foru8
s,u16
s andu64
s.Admittedly, I'd like it to be refactored at some point so the code can become cleaner. For now, however, this ought to suffice. In the meantime I'll try to think if there are other optimisations we can perform.
Oh, and also: Seeing as the LUTs for each function were only being used within that one function, I took the liberty of moving them inside those functions.