Hacker News new | ask | show | jobs
by FrozenVoid 3307 days ago
Years ago i was naive enough to believe these benchmarks. Now i know these are Potemkin-village level stunts and political maneuvering by language activists and staff of that site. If you really want actual benchmarking you have to do it yourself and read the .asm output for comparison. Another caveat is that some languages are genuinely faster in one hyperoptimized case(even faster than C) but fail horribly when things go more complicated and abstraction creep makes them much slower in most cases.
4 comments

You provided zero evidence for your claim. I'm not saying you're necessarily wrong, but so far you have only made an assertion.

If you think some language is misrepresented in that benchmark, you can submit your own solution.

The problem is subjective and thus more difficult to provide evidence for.

I don't think the parent doubts the runtimes or is claiming that the code for his pet language wasn't written properly and therefore the site is a sham. The issue is: what is reasonable code?

Benchmarks invariably become a game of massaging the code to produce the optimal assembly. And that's the problem. The reason that we invented higher level languages was so we could stop thinking about assembly. The point of most higher level languages is not to optimize CPU cycles, but to optimize human brain cycles. If we only cared about speed (and not at all about development time), we would just write all code in assembly.

I am not particularly interested in how fast meticulously fine tuned code in a given language runs. I have no doubt that, given enough time, an excellent programmer can finely craft a block of code to run very fast in any half decent language. And this site is evidence of that.

What I want to know, and what benchmarks never show, is which languages make writing performant code simple, idiomatic, and natural. Which languages give me good performance, without having to really work for it?

This is an amazing site, but it is a stretch to think that it compares languages. It compares programmers and their implementations. The implementations are more like their own art form, like Chess or something.

>> I don't think the parent doubts the runtimes or is claiming that the code for his pet language wasn't written properly and therefore the site is a sham. <<

We could always take the parent at their word -- "Now i know these are Potemkin-village level stunts and political maneuvering by language activists and staff of that site.".

Have you looked at the winning submissions code? Every single one I saw (not all of them) was just a straightforward implementation of the algorithm / solution. I don't see much weirdness.
Yes. For example I noticed the typescript one. The implementation is straightforward, yes, but it is just plain javascript. It doesn't need TSC at all. So why call it typescript? If you're going to say it is typescript at least use types, no?

Or the ruby ones. Not much like ruby I have ever seen. It's not particularly difficult to write C code that can be easily called from ruby which is why I guess most ruby programmers wouldn't bother to write code like this in ruby. If you want C, just write C!

I think all the implementations are straightforward as implementations. But few are the most idiomatic way to express the alogorithm in that language.

Specifically which "typescript one"? (Currently 15 typescript programs are shown.)

Specifically which "ruby ones"? (Currently 37 programs are shown.)

>> the most idiomatic way <<

One person's idiomatic is another person's idiotic.

On how the benchmarks should be interpreted http://benchmarksgame.alioth.debian.org/for-programming-lang...
I had the same observation. I'm a Perl fan, but I can see some submissions were solely motivated to make Perl appear competitive. Like using threads in Perl, which isn't often done in real life.

I'm not sure how much evidence is needed. It seems obvious that people who are fans of language X are going to submit code with the sole intention of bumping up performance at any cost.

The site is still interesting, but probably useless for real world decision making.

Doesn't matter, if you don't use threads in Perl when you could, that's your fault and benchmarks like this serve to remind you should. There are folks who use threads with their Perl code in real life btw
It's not even enabled in several major distributions. Yes some people do use them. Most don't...it was broken for several releases.
I don't find the .asm output to be meaningful at all. The realistic comparison for me is if I write a solution the easiest/most convenient way in each language, which language is naturally more efficient.
>> Now i know these are Potemkin-village level stunts and political maneuvering by language activists and staff of that site. <<

That's just name-calling.

How do you read an asm output for PHP, python, erlang, Lua, Java, JavaScript?