4 ms·
What's the deal with pidigits? Losing out bad to PHP here even.
by Rickasaurus 13y ago
What's the deal with pidigits? Losing out bad to PHP here even.
- iopq 13y agobecause it's not using GMP
- saidajigumi 13y agoSo if I understand correctly, the pidigits test in this case this isn't a self-contained, fully ported microbenchmark, but rather a test of some random Rust code vs. an optimized library[1]? If that's true, then what's the point of including pidigits if the entire algorithm isn't going to be ported into all target languages? [1] GMP, The GNU Multiple Precision Arithemtic Library: https://gmplib.org/ https://gmplib.org/
- iopq 13y agoIt's more of a "testing the platform" rather than the language. You can write a Rust program that runs at exactly the same speed as a C program (the difference here would be clang backend vs. gcc moreso than the choice of language).
- wmf 13y agoThat becomes more of a pass/fail test (either you're using the fastest known library or you aren't) which isn't very interesting as a benchmark.
- pcwalton 13y agoAs I understand it, the rule is "if your language comes with a bignum implementation, you must use it, otherwise you may use GMP". I've been seriously tempted to suggest removing our bignum implementation for this reason (though I won't).
- qbproger 13y agoPython uses GMP while having a bignum implementation. I believe any language is allowed to use it. Python: http://benchmarksgame.alioth.debian.org/u64/program.php?test=pidigits&lang=python3&id=2 http://benchmarksgame.alioth.debian.org/u64/program.php?test... Ruby: http://benchmarksgame.alioth.debian.org/u64/benchmark.php?test=pidigits&lang=yarv&id=2&data=u64 http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...
- igouy 13y agoThere is no such rule. When someone contributes a Rust pi-digits program that uses GMP it will be shown (as long as it uses the same algorithm). We get to see both programs that use GMP and programs that don't.
- legulere 13y agoBignum math isn't optimized for performance yet. See this discussion: http://www.reddit.com/r/rust/comments/1xcq1q/c_gcc_vs_rust_wtf/ http://www.reddit.com/r/rust/comments/1xcq1q/c_gcc_vs_rust_w... There are also already some patches making rust a lot less worse: https://github.com/mozilla/rust/pull/12209 https://github.com/mozilla/rust/pull/12209
- pcwalton 13y agoA fix is in the queue. It was a tiny thing. Currently there is an Android buildbot issue that is preventing anything from landing, but hopefully that will be resolved today.