On 01/09/14 08:51 AM, Cody Mack wrote: > Hi, > > Regarding issue #8937 (https://github.com/rust-lang/rust/issues/8937), > add a BigDecimal type, there is discussion about wrapping GMP, and > even possibly replacing Rust's current BigInt with this wrapper. One > comment mentions that Rust's current BigInt is ~100x slower than GMP > in some cases. However, GMP is licensed under LGPL. > > 1. Are there benchmarks displayed somewhere for comparison of BigInt > vs. GMP? It would be helpful to know cases from where the factor 100x > came.
Rust's BigInt has progressively more inferior *time complexity* as the numbers get bigger. It's far worse than 100x for very large numbers. It's significantly slower for relatively small numbers because it lacks years of work writing optimized assembly. This gets more important as domain specific instructions like MULX are added to CPUs, along with more diverse SIMD instructions with wider registers. Auto-vectorization doesn't work for complex cases like this.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev