3 ms·
Very cool, and definitely gives me some insight into those benchmarks. Which makes me wonder -- are there benchmarks for "boring" programs in a variety of langu
by dikaiosune 11y ago
Very cool, and definitely gives me some insight into those benchmarks. Which makes me wonder -- are there benchmarks for "boring" programs in a variety of languages? I'm generally more interested in the execution speed of implementations that I would actually have time to write when on a deadline.
- kibwen 11y agoThe best thing for your purposes would be a site that attempted to optimize for the appearance of idiomatic code, which you could then secretly use to gauge the performance of code that's idiomatic to each language. In other words, entirely remove performance showboating as an incentive. Rosetta Code (http://rosettacode.org/wiki/Rosetta_Code http://rosettacode.org/wiki/Rosetta_Code) may be the closest to what you want, though I can guess that most of the Rust implementations were written prior to 1.0 and won't even compile anymore, let alone represent idiomatic code. :P
- dikaiosune 11y agoI like that idea -- although I would agree that Rosetta Code often does not represent idiomatic code, even for longer-established languages. The wikibooks algorithms book might also be a good candidate, although I've not yet seen Rust on there.
- igouy 11y agoIf only you'd look at the code, you might get some insight. You might see some boring programs. You could always contribute some boring programs ;-)
- gus_massa 11y agoMany languages have a few programs for each benchmark. You can try looking at the shortest one. Most submitters try to optimize for speed, and to use smart tricks you need more LOC, so usually the shortest program is the more straightforward. Actually, in this site they don't measure the size of a program in LOC, they use the size of the compressed program that is a better metric. (It may be different in other sites specialized in code golf, because in the those sites the submitters are specializing for size specifically.)
- Klasiaster 11y agoAs you can see here, code amount is also measured: http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=rust&lang2=gpp http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan...