3 ms·
I believe the performance differences on The Computer Language Benchmarks Game is largely due to the implementations themselves. For one, pidigits have been tra
by johnisgood 8y ago
I believe the performance differences on The Computer Language Benchmarks Game is largely due to the implementations themselves. For one, pidigits have been translated from Pascal to Ada using p2ada. I do not think that this is a fair comparison at all.
- galangalalgol 8y agoI agree on that one, I'm rusty at ada, bad pun, but someone should profile and fix it. The n body one is half the speed of rust and it is hand tweaked using simd instructions. I wouldn't mind at all goin back to Ada. Most of the people that switched to c++ did so in order to have a larger hiring pool or to seem more modern. Some of them are switching to safety critical Java now for the same reasons. I suspect safety critical python is on the horizon. If airliners have to start worrying about python 2/3 headaches I'll know it is time to retire.
- johnisgood 8y agoYeah, I wish we had Ada experts fixing and optimizing them. That would be neat! It matters a lot to people, and Rust versions have been optimized to oblivion by many people. It should be done with Ada, too, to have a fair comparison. :) And yeah, it is a valid and very serious issue. If we had more Ada programmers, we would not have to sit in trains or airplanes "powered" by C++, haha.
- igouy 8y agoEven being rusty at Ada, you may be able to fix this regex program: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/regexredux-gnat-6.html#log https://benchmarksgame-team.pages.debian.net/benchmarksgame/... https://salsa.debian.org/benchmarksgame-team/benchmarksgame/blob/master/CONTRIBUTING.md https://salsa.debian.org/benchmarksgame-team/benchmarksgame/...
- igouy 8y agoThe other Ada pidigits program currently fails because output checking was made more restrictive: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/pidigits-gnat-2.html#log https://benchmarksgame-team.pages.debian.net/benchmarksgame/... It would be great if you would contribute a program that fixes this trivial problem: https://salsa.debian.org/benchmarksgame-team/benchmarksgame/blob/master/CONTRIBUTING.md https://salsa.debian.org/benchmarksgame-team/benchmarksgame/...
- johnisgood 8y agoI tested the code. It compiles and runs just fine. I compared the checksum of the output from both Rust and this version, they are identical: md5 5b185f9a67a426baf78aa3bbb5baf8df out_rust md5 5b185f9a67a426baf78aa3bbb5baf8df out_ada On top of that, I got this: Rust: real 0m0.702s user 0m0.693s sys 0m0.007s Ada: real 0m0.708s user 0m0.706s sys 0m0.000s Why don't you use this version instead? The output is correct and identical to Rust's, and the performance is significantly better: just as fast as C and Rust, as expected. Thanks for letting us know about its existence!
- igouy 8y ago> I compared the checksum At what N? > The output is correct Nope. diff 3c3 < 6264338 \ No newline at end of file --- > 6264338 :27 PROGRAM OUTPUT: 3141592653 :10 5897932384 :20 6264338
- johnisgood 8y agoHere is the code that should solve your output issue: https://slexy.org/view/s21DoMQaHF https://slexy.org/view/s21DoMQaHF
- igouy 8y agoThanks, done.
- johnisgood 8y agoNo worries. I got rid of the unnecessary `range' in the last version, but it does not matter much anyway.
- igouy 8y agoMy guess is that the Ada regex-redux #6 program is also easily fixable: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/regexredux-gnat-6.html#log https://benchmarksgame-team.pages.debian.net/benchmarksgame/... :and there's a working Ada regex-redux #5 program: https://benchmarksgame-team.pages.debian.net/benchmarksgame/program/regexredux-gnat-5.html https://benchmarksgame-team.pages.debian.net/benchmarksgame/...