As the page says, "No. Which programming language implementations have the fastest benchmark programs?"
Which begs the question - aside from macho bragging rights, exactly what good is this kind of information?
Assume I did have a specific problem case for which performance in terms of memory, time or LoC mattered. As a first step, I'd write a specific benchmarkable implementation of my own problem (or one very like it.) Then I'd need to profile and optimise that implementation in my chosen language(s), as well as stop and think laterally about ways I might be able to optimise around that specific problem.
This is all assuming I'm working on a greenfields project where I have absolute free choice of language & runtime environment. Which happens for my personal projects, but never yet for a professional one.
Not to mention that in all other cases apart from this hypothetical where performance matters, I would take the most human-readable program over the most fast, lean or concise one.
Long story short, at no point can I see myself stopping and saying to myself. "You know what I need now? I need to see which programming language can generate a Mandelbrot set bitmap with the smallest memory footprint, without using any 'unfair' optimisation techniques."
A while back, I wrote a program to solve a puzzle. The more complex the puzzle, the longer it took to solve. Today, I might come up with a better algorithm, but back then, all I could find was a brute-force approach. The most complex puzzle I had seen at the time was taking hours to run.
The program was written in VB6, and it was just wasn't mean for CPU-intensive programs like that. If I were to write that program again today, I'd be looking at optimizing the code for speed, starting with the language.
Today, I might come up with a better algorithm, but back then, all I could find was a brute-force approach. The most complex puzzle I had seen at the time was taking hours to run.
I bet that you could come up with a better algorithm now, even in VB6 if you had to, to get the run time down. I've seen people take "optimised" C solutions that run in hours and make them run in minutes, just by rewriting the algorithm and rethinking basic assumptions.
You're entirely correct on both counts. In fact, all 3 of those reasons given on that page are good ones.
However, this was still posted under the title "Which programming language is the fastest?" - so I think it's worth exploring in exactly what ways that is or isn't useful information. Just as their own reason #3 says - "To show how difficult it can be to make meaningful comparisons"
I'd also question exactly how useful reading toy benchmark solution code is to real problems. The code to the benchmark problems is often nicely written, but if I have a problem to solve then wouldn't I be better off looking for samples of readable code that solve problems related to my specific problem domain?
> worth exploring in exactly what ways that is or isn't useful information
Now consider how you could use the varying performance on different tasks, and the varying performance on the same task of programs written in the same programming language, as examples (as a resource) for exploring (and showing to others) in what ways you think that is or isn't useful information.
If we just consider those "Which programming language is the fastest?" pages, then I think - simply getting someone to look away from a single number ranking (the median) and notice that for some language implementations the performance range is relatively small but for others the range is enormous - is useful.
> I'd also question exactly how useful reading toy benchmark solution code is to real problems.
Someone's told me that n-body pretty much is what they get paid to work on. Someone's told me that k-nucleotide and reverse-complement are pretty much is what they get paid to work on. The question as usual is who's "real" problems?
> wouldn't I be better off looking for samples of readable code that solve problems related to my specific problem domain?
Perhaps - and yet for some people what they see in those tiny tiny programs will be enough for a personal opinion about whether X is "the most human-readable".
These are all good points. I must confess, when I first looked at some shootout problem code a few years ago I remember being in violent disagreement about how some of the solutions were implemented (ie thinking "If I were solving this problem in a non-toy way I wouldn't do it that way, that's a total hack for benchmark purposes"), but it looks like they've evolved a fair bit and I can't find the same complaints I had then - so kudos for that. I need to recalibrate some of my opinions on that front. :)
Given that this sounds like its your own project, I have a vague idea that you might find interesting: Is there a way to present the results in an additional way which is framed initially as "look at the different ways to solve subproblem X" rather than "look at the graph of performance differences"? It could be an interesting approach to have an alternative additional interface that makes browsing the sample code (maybe with annotations?) front and centre, with a focus on programming techniques as a major differentiator, with scores as an adjunct. At present the visitor is encouraged to start from benchmark scores (either for everything, for a problem, or for a language) and from there move to source code later, but there might be a way to frame it as "let me flip through solutions to problems like X and tag the ones I like the look of, then let's see how they performed"
It's a pretty vague idea, and I don't have much of a handle on how it'd work from a UI perspective, but its seems like it might head off some of the kneejerk responses you get from kneejerkers like me ;), plus it could help encourage some of the uses you're describing in your post.
Exactly, I can't believe (what seems like a) majority of developers are still talking about language performance (and optimization). It matters for a small subsegment of our industry. The rest, speed/cost to implement and maintain far outweigh raw language performance.
Yes! Also, even when you do care about performance, general performance isn't ever the same as specific performance.
You have to optimise to your use case, not some arbitrary general use case like "render a Mandelbrot set" or "calculate pi". If I have a slow On^2 Erlang algorithm, then I'm a lot better off looking at ways to rewrite it as Olog(n) instead of scrapping Erlang and moving to Java because it had a better score on the programming language shootout.
"Most (all?) large systems developed using Erlang make heavy use of C for low-level code, leaving Erlang to manage the parts which tend to be complex in other languages, like controlling systems spread across several machines and implementing complex protocol logic."
Most (all?) large systems developed using Erlang make heavy use of C for low-level code, leaving Erlang to manage the parts which tend to be complex in other languages, like controlling systems spread across several machines and implementing complex protocol logic.
I know, when programming in Erlang I have unsurprisingly done exactly this. If I had an On^2 solution in Erlang that I knew I couldn't rewrite in Erlang to be faster, then that's my last resort - I'd write a C port to perform my particular inner loop performance-limited code, and leave the rest in Erlang.
However, I wouldn't either (a) go directly to C without trying to optimise the solution in Erlang first, or (b) look at a list of other languages and wonder which one I could move my entire program to.
While one specific benchmark may not sway your decision on which programming language to use for your own projects, it should certainly be a factor when designing a large web application for hundreds of thousands of users. Unless of course you say that benchmarks are irrelevant and do not measure anything that corresponds to real world performance. But that would be like saying it does not matter whether you use a bicycle, a car, or a jet engine to travel from Point A to Point B, since intrinsic speed of your choice mode of transportation is difficult to measure, and is irrelevant.
While one specific benchmark may not sway your decision on which programming language to use for your own projects, it should certainly be a factor when designing a large web application for hundreds of thousands of users.
Sure, but the benchmark has to fit the use case. If you're designing a large web application, find benchmarks for large web applications or write benchmark cases yourself that match the use cases you're going to see and think you need to optimise for.
I seem to remember that at one point, Pypy, Luajit and perhaps a Ruby interpreter were removed from the races.
Anyone have any details on why that happened? These destroyed my ability to link to the shootout as data for showing that languages don't matter as much as implementations do, a nuance many newbies miss :(
But let's note that here CINT is only being used as a C interpreter but a CINT script can call compiled classes/functions and compiled code can make callbacks to CINT interpreted functions - which I'm sure you understand would make it a lot faster.
Which begs the question - aside from macho bragging rights, exactly what good is this kind of information?
Assume I did have a specific problem case for which performance in terms of memory, time or LoC mattered. As a first step, I'd write a specific benchmarkable implementation of my own problem (or one very like it.) Then I'd need to profile and optimise that implementation in my chosen language(s), as well as stop and think laterally about ways I might be able to optimise around that specific problem.
This is all assuming I'm working on a greenfields project where I have absolute free choice of language & runtime environment. Which happens for my personal projects, but never yet for a professional one.
Not to mention that in all other cases apart from this hypothetical where performance matters, I would take the most human-readable program over the most fast, lean or concise one.
Long story short, at no point can I see myself stopping and saying to myself. "You know what I need now? I need to see which programming language can generate a Mandelbrot set bitmap with the smallest memory footprint, without using any 'unfair' optimisation techniques."