Rust on Computer Language Benchmarks Game
benchmarksgame.alioth.debian.org
benchmarksgame.alioth.debian.org
http://alexgaynor.net/2011/apr/03/my-experience-computer-lan...
Sounds entirely reasonable to me.
They seemed to have addressed most of the fairness and "What about language X on platform Y using framework Z" kinds of questions with "Send us a pull request and we'll include it in the next benchmark".
I'm tempted to tackle this even though I don't currently have the time.
[1] http://www.techempower.com/benchmarks/ [2] https://github.com/TechEmpower/FrameworkBenchmarks
I believe they have plans to add additional tests which will allow for caching and that kind of thing.
I don't think that removing caching across all frameworks equally is creating 'artificially hamstrung implementations' as all the frameworks would benefit from caching.
I'm not saying it would be easy (or economically viable), but it's certainly possible. Somebody should try it.
This isn't an automateable task, although it may be a crowdsource-able one. Luckily the benchmark game publishes pretty much all of the tooling they use, so you could probably get a pretty big headstart there on your improvements.
NOT TRUE.
Programs optimized for PyPy were accepted and shown alongside programs written for CPython. Joe LaFata contributed excellent PyPy pi-digits, spectral-norm, mandelbrot programs and they were all accepted.
>>banning multiple implementations<<
NOT TRUE.
Measurements for both JRuby and CRuby are shown.
Like everyone else, I'm sitting on my hands waiting for someone else to make and publish all the other program measurements.
The implementation pick ranges from the standards that everyone uses to the experimental that nobody but the language developer uses.
That's sad. Someone should fork it... would be great.
Another good benchmark that compares them all: http://www.techempower.com/benchmarks/#section=data-r8&hw=i7... (found it on HN some month ago)
I know maintaining a project like that is a lot of work. But adding superior implementations of already featured languages should be a piece of cake. Source code of Python, PHP and Lua is already in the repo, it's just a matter of installing the VM's on the computer and modify the scripts.
Beside, if the maintainer reads this, please keep up the good work, and maybe add LuaJIT, PyPy and HHVM. Thanks.
PyPy was shown (on my initiative) and I asked for (and published) programs that would work with PyPy. For example check the comments here -- http://morepypy.blogspot.com/2010/03/introducing-pypy-12-rel...
LuaJIT was also shown; HHVM was never shown.
http://web.archive.org/web/20110125034347/http://shootout.al...
That can be a pretty huge "it's just". In practice many of the existing scripts make use of C bindings or rely on odd behaviors that aren't replicated by alternate VMs. Since the alternate implementation, benchmark programs, and benchmark tools are all available, I'd recommend you put your theory to the test. It'll either prove eye opening or make for a nice contribution back to the game!
HHVM is compatible with PHP 5.3, LuaJIT with Lua 5.1 and PyPy with Python 2.7.3. All benchmark code is written the languages code and sometimes relies on an language extension library (which is written in C or C++). But three above JIT VMs come with their own compatible language extension libraries or support the extension API.
Look at the code, it should be easy: http://benchmarksgame.alioth.debian.org/u32q/benchmark.php?t... and https://github.com/kragen/shootout/tree/master/bench
Otherwise people might get the impression that C is the "speed of light" as far as program speed is concerned.
The simple facts are that the JVM is the most advanced and efficient VM available today, and the JVM is specifically targeted to increase the speed of Java. It's not much of a stretch to expect good speed out of that regardless of strange preconceptions you may have had.
The Go VM has a long long way to go be even remotely comparable to the JVM in garbage collection etc.
Apparently, the cutoff is defined like this: as slow as Java is not slow, but any slower than Java is slow.
One thing that surprised me about that benchmark is how many languages fall into the "2 to 3 times slower than C" category. They all have various merits, but seemingly equal performance. I've also noticed each of the languages I'm familiar with have gone through a hopeful stage of "were as fast as C" only to fall short.
* the type system doesn't provide any more information to optimize against * lack of generics means you're going to incur runtime type checks to unpack data out of containers * internal pointers force a choice between ignoring advanced garbage collection (which usually involves moving data in memory), making all object accesses a double pointer dereference (to allow moving), and forcing the user to specify at allocation time if the object should be eligible for movement. All of these choices suck.
Personally, I don't expect Go to ever be "faster than Java". Maybe (hopefully!) I'm wrong, but these are big roadblocks.
Also, the default Go compiler essentially has no optimiser at all, just some weak inlining + a language designed to be easy to compile directly to non-horrible machine code without much effort. GCCGo will be much faster.
A company did that back in Dezember: http://www.techempower.com/benchmarks/#section=data-r8&hw=i7... (found it on HN)
Revel uses LuaJIT (afaik), HHVM is HipHop PHP (Facebook) and you can find PyPy there too.
"This test exercises database writes. Each request is processed by fetching multiple rows from a simple database table, converting the rows to in-memory objects, modifying one attribute of each object in memory, updating each associated row in the database individually, and then serializing the list of objects as a JSON response."
You're actually just benchmarking the mysql driver for each of those languages, not the actual JIT capabilities.
See this discussion: 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
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/
Python: http://benchmarksgame.alioth.debian.org/u64/program.php?test...
Ruby: http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...
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.
All the shootout* ones.
It's important to track this over time to make sure regressions don't get in.