Closed konstin closed 10 months ago
Thanks for pointing this out. I'll include this optimization in the next release.
Fixed in 0.4.3.
See https://github.com/mhogrefe/malachite/blob/v0.4.3/malachite-nz/src/natural/conversion/string/from_string.rs#L204; that is the optimization for Natural
s, and the Integer
and Rational
parsing code forwards to it.
Sorry, v0.4.3 had some wrong dependencies. Please use v0.4.4 instead.
We found that replacing
with
for cases where we know that radix is 10 gives a significant speedup for our use case (parsing a lot of number which are generally small). It would be great if malachite would natively contain such an optimization, which could be extended by e.g. checking whether the first by is
-
.