News for hackers. Stuff that matters.
Re:Why did Clojure gain so much popularity? by pron on Wednesday April 24, 2019 @10:51PM (#19744611)
Alright, so first of all, to qualify my "name calling" let me say this: the benchmark game does have a lot of valuable data, that can be useful for all sorts of things. In particular, it can be used to study which low-level algorithms and language specific optimizations make a difference when comparing different programs in the same language. Of all the things the data can be used for, one of the least useful ones -- to the point of being nearly meaningless -- is comparing the performance of different languages to each other, the thing that the game's presentation emphasizes most. Why is it nearly useless for that? Because the programs were written by different people and use different low-level algorithms; sometimes the benchmarks measure compiler quality, sometimes library quality, and most often it measures the optimization skill (and patience) of the various program authors. Also, usually comparisons are made along one axis -- same program, different compilers; different languages but same algorithm and author; different authors but same language and compiler; here, all factors change with every test. Here, we have two programs presented next to each other, with differences along three or four variables, each can impact the result by tens or even hundreds of percent, and then we see a difference of, say, 40% between the two. What does that even mean?

All these things make the inter-language comparison as presented nearly useless. Crucially, the site itself doesn't even state what it is that it purports to measure or compare, like a paper without any hypotheses, claims or exposition. That alone is enough to place it in the low-quality benchmark category (regardless of the merits of the problems themselves, which I haven't looked at). But that's where most non-professional benchamrks are. ¯\_(ツ)_/¯

Now, I would guess that there is some meta-hypothesis to the game pertaining to markets, but that's not what's being analyzed or even presented.

> Which programs?

I tried to look at programs that report big performace differences and I'm looking at C++'s regex-redux, and I see it uses a library that isn't in the standard library. Or look even at "Java" vs "Substrate VM" pidigits. These are two VMs for the same language, yet the programs are completely different. I'm not sure what I could learn from that about HotSpot vs Substrate VM.

Or, the example that caught my eye when I reached the game when looking for SBCL benchmarks -- SBCL's reverse-complement, that is reported to outperform C by more than 10x. Well, not only does it use a completely different low level algorithm (doesn't use parallelism), it doesn't outperform C or Java at all, but crashes, and what appears to be some junk result is reported. Had it not crashed, it would still have used a very different algorithm.

> So why haven't you told us how few 1/10ths of a second?

Because that would be misleading. Now, I admit that what threw me off at first was Java's performance compared to SBCL's reverse-complement, but that's just a mistake and has nothing to do with compilation. Real programs can take many seconds to compile, but looking at the benchmarks, they do look quite small, so you are correct that they will be compiled rather quickly (less than a second). However, I see that Java is run with tiered compilation, and obtaining good optimization, even for such small programs, can still take many seconds (say 10 or 30). As a general rule of thumb, we always warmup for at least a few seconds, even for microbenchmarks.

It is true that the difference would often not be large compared to the inter-language differences reported by the benchmark -- and as I said above, it's unclear what it is they compare -- but they can certainly be in the 5-10% range, and maybe more. This is a big difference for what I call "high quality" benchmarks, benchmarks intended to really give a precise performance measurement. For example, Twitter has a whole machine learning system that tunes and re-tunes their JVMs just so they can get a 7% performance improvement. Even the game's own examples that you linked to and seem to say, see, warmup doesn't matter, report differences of 10-200%.

> Which programs?

Now I'm looking at Haskell's fannkuch-redux

> And don't you expect code written to be fast to be different?

Yes, and if the comparison was for the same language (and compiler) then this would be interesting, but what does this tell you when comparing different languages?

Re:Why did Clojure gain so much popularity? by igouy on Saturday April 27, 2019 @12:33PM (#19766327)
And 2 days later, way down-thread ( https://news.ycombinator.com/item?id=19766017 )

> > So when you say "the relative speed of those languages" you actually mean the relative speed of programs?

> No, I mean the relative speed of programs with some carefully chosen relation between them. For example, there is a big difference between "relative income of individuals" and "relative income of social groups," even though the latter could be reduced to the former. Whether a comparison of individuals is meaningful as a comparison of groups depends on how the individuals are chosen and aggregated.

You can choose which program measurements to compare.

> > We can make mystery for ourselves — no one can force us to understand.

> True, but when a website chooses to present data in some aggregate way that seems to defy any familiar forms of aggregation and reasoning without so much as stating what the meaning of the presentation is, it is itself mysterious.

You have not shown that is what that website does.

I agree that it is possible that the comparisons are not worthless, but without any statement of a hypothesis, it is the most reasonable conclusion.

Yet another tendentious assertion!

Program X measured less than Program Y.

I am sure that the authors of the website would agree that if they don't even attempt to say what the meaning of the comparisons is, even in their own minds, it is reasonable to assume it means nothing.

Once more, you are putting your thoughts and words in others' mouths.

Re:Why did Clojure gain so much popularity? by pron on Sunday April 28, 2019 @06:57AM (#19770437)
> You can choose which program measurements to compare.

Yes, but the website also chooses, and it is the website's choice that I think is bad. Also, it doesn't seem like the game even has comparable programs in some/many/most cases.

> You have not shown that is what that website does.

How can I show what a website doesn't do? If you think they say what the hypothesis is, show me. I haven't been able to find it.

> Program X measured less than Program Y.

First of all, when something means nothing other than itself, we say it has no meaning. If the comparisons on the website are meant to suggest nothing more than just their own definition, then they are meaningless.

Also -- come on. The website presents comparisons for specific choices of X and Y. What is the meaning of the choice and the resulting comparison? Your position that it's not meant to mean anything (other than itself), sounds disingenuous because the website still makes some very specific choices that seem to hint at a meaning (e.g. why not compare the second fastest programs between languages instead of the fastest?) yet the meaning is never explained.

Anyway, we're going in circles.

Re:Why did Clojure gain so much popularity? by igouy on Monday April 29, 2019 @01:22PM (#19780427)
> … comparable programs…

For someones definition of "comparable".

> How can I show what a website doesn't do?

You can try to show your claim — "… chooses to present data in some aggregate way that seems to defy any familiar forms of aggregation and reasoning…" — has some basis in reality.

> … when something means nothing other than itself, we say it has no meaning.

That may be what you say. Show why we should think that's what people interested in "Why did Clojure gain so much popularity?" would say.

> … why not compare the second fastest programs between languages instead of the fastest?

Inexplicable! Or obvious: there would need to be two programs for each, rather than one.

> Anyway, we're going in circles.

I agree, you repeat your assertions without establishing anything.

Re:Why did Clojure gain so much popularity? by igouy on Thursday April 25, 2019 @12:48PM (#19749978)
1) Of all the things the data can be used for, one of the least useful ones -- to the point of being nearly meaningless -- is comparing the performance of different languages to each other, the thing that the game's presentation emphasizes most.

Is that what the presentation emphasizes most?

"Will your toy benchmark program be faster if you write it in a different programming language? It depends how you write it!"

"Which programs are faster?"

"Which programs are fast?"

"Non-motivation: We are profoundly uninterested in claims that these measurements, of a few tiny programs, somehow define the relative performance of programming languages."

2) Or look even at "Java" vs "Substrate VM" pidigits.

Currently 2 Java pidigits programs are shown.

The program with the fastest measurements on OpenJDK uses GMP and something different needs to be done to make that program work on Substrate VM.

3) …but crashes, and what appears to be some junk result is reported.

What is reported? Measurements at the largest workload both programs worked.

4) examples … you… seem to say, see, warmup doesn't matter

See, for programs with runtimes of 0.24s, 1/10th of a second is a lot!

See, for programs with runtimes of 4s and 20s, 1/10ths of a second… !

5) Now I'm looking at Haskell's fannkuch-redux

And… ?

6) … if the comparison was for the same language (and compiler) then this would be interesting, but what does this tell you when comparing different languages?

That seems to be a subjective statement about your interests.

Someone else might think that neither "tell you" much until you investigate Why?

Re:Why did Clojure gain so much popularity? by pron on Thursday April 25, 2019 @02:13PM (#19750952)
> Is that what the presentation emphasizes most?

Yes, because that's what the site shows most prominently: comparisons between languages.

The fact that the explanations to the benchmarks basically say that these comparisons mean nothing doesn't make the comparisons mean much more than nothing, especially as there's no explanation to what the comparisons do (or are supposed to) mean. So in addition to having no hypothesis, no analysis and no exposition, there's a notice saying, don't use these comparisons for so and so. Then what are those comparisons for?

Again, I don't think the game's comparisons are worse than many other benchmark comparisons out there, but that doesn't make it good. What's unfortunate is that unlike those other benchmarks, they have a lot of data that could be used for some really cool stuff (not to compare languages).

It's possible that the language competition is meant to encourage more people to submit and show how their favorite language wins, but there's no information about the market aspects.

> See, for programs with runtimes of 4s and 20s, 1/10ths of a second… !

I run a toy benchmark that's the same size as the game's, and HotSpot's C2 gives me a 30-50% boost after ~10s. It really varies by program (not by problem). This tends to be worse for programs that use a lot of parallelism and aren't configured to run compilation in blocking mode, because then the application threads compete with the compilation threads, but again, there isn't really a good rule of thumb here. In any event, it is simply wrong that C2 would never yield significant performance boosts after a few tenths of a second, even on small programs (it may be true for some specific benchmark entries and maybe even all current ones, it may vary by JDK version, and it definitely varies on whether HotSpot uses Graal or C2). Although, given all the other serious problems that render the comparisons mostly meaningless (different algorithms), my guess would be that this effect is smaller by comparison.

Still, there's a lot of cool stuff the game could do with the current programs (and historical ones), but comparing languages is not really one of them.

Re:Why did Clojure gain so much popularity? by igouy on Thursday April 25, 2019 @03:09PM (#19751491)
> … what the site shows most prominently…

Program after Program after Program.

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Of course, it's really not possible to show any computer program which is not written in a programming language.

> … basically say that these comparisons mean nothing …

Obviously not: please don't put your words in others' mouths.

> … a lot of data that could be used for some really cool stuff…

Take the data and do that really cool stuff.

https://salsa.debian.org/benchmarksgame-team/benchmarksgame

> … but there's no information about the market aspects.

What do you mean by "market aspects" ?

> …it may be true for some specific benchmark entries and maybe even all current ones…

So it would be wrong to try to dismiss those measurements, based on nothing more than extrapolation about how some other toy benchmark program might perform.

> … cool stuff the game could do …

You're allowed your own personal opinion about what's cool and what isn't (and no doubt others will have their own personal opinion).

Re:Why did Clojure gain so much popularity? by pron on Thursday April 25, 2019 @04:44PM (#19752347)
> Obviously not

It's certainly not obvious to me what they comparisons mean (is it obvious to you?) and the authors of the site don't even state, let alone support, a hypothesis. They just say what the comparisons don't mean. So unless it's a work of art, I think observers can be forgiven for thinking it doesn't mean anything.

> What do you mean by "market aspects"?

I mean a hypothesis about "free market competition" driving people to write really fast programs.

> You're allowed your own personal opinion about what's cool and what isn't

True, but I meant something that could be used in a more rigorous/meaningful way (e.g. comparisons where only one variable changes). Meaning is perhaps also subjective, but I don't even know the subjective opinion of the meaning behind the game, because the site doesn't say.

> https://salsa.debian.org/benchmarksgame-team/benchmarksgame

Cool.

Anyway, now that I've taken a slightly closer look, I realize I spoke too soon when I said that the SBCL vs. Java benchmark is "better than nothing." If, say, Java uses parallelism while SBCL doesn't, then if Java is 4x faster that may not be a "better than nothing" indication.

Re:Why did Clojure gain so much popularity? by igouy on Thursday April 25, 2019 @08:24PM (#19753792)
> not obvious to me

Program X measured less than Program Y.

> … comparisons where only one variable changes…

Seems like your idea of a comparison, between for-example Lisp and Java programs, would require writing all the Lisp programs as if they were being written in Java. (We used up our "one variable change" with SBCL instead-of OpenJDK).

> I spoke too soon

You chose to summarize data: "Java outperforms SBCL by a very wide margin -- 1.25-4x faster".

Do you mean that you made mistakes when you made your summary.

Re:Why did Clojure gain so much popularity? by pron on Friday April 26, 2019 @04:33AM (#19755682)
> Program X measured less than Program Y.

That's like asking what does a program do and being told, "it does what the code says." Technically true, but not what we mean when we ask. Also, I don't think that's really what the site's authors thought. After all, when I click on the Haskell page, I don't see a comparison of Haskell programs, but a comparison of the fastest Haskell program with the fastest Java program. It's not obvious to me what that means, or even that it means anything at all.

> Seems like your idea of a comparison, between for-example Lisp and Java programs, would require writing all the Lisp programs as if they were being written in Java. (We used up our "one variable change" with SBCL instead-of OpenJDK).

That's exactly right, but because that's rather tedious, I would present just meaningful comparisons rather than non-meaningful ones, so no inter-language comparisons. I'm not saying they're always meaningless, but they can't be made with the data currently available on that site. Unfortunately, we cannot manufacture (non-fictitious) meaning out of data as we like.

> Do you mean that you made mistakes when you made your summary.

Yes. By "better than nothing" I overestimated the significance of results, at least in this case. After a closer look I realized that different programs use different algorithms, and so the comparison tells me nothing about the relative speed of those languages.

Re:Why did Clojure gain so much popularity? by igouy on Friday April 26, 2019 @11:07AM (#19758273)
> That's like…

No it is not. Program X may not have measured less than Program Y.

> … meaningful comparisons…

Earlier you complained there was "code that's very unidiomatic" but now you say "writing all the Lisp programs as if they were being written in Java" would be exactly right?

1) You seem to be contradicting your own argument.

2) Your desire for "rigorous" comparison is in-conflict with your desire for inter-language comparison.

> … different programs use different algorithms…

For some programs, for some definition of "algorithm".

> … the comparison tells me nothing about the relative speed of those languages.

What is the speed of a programming language?

Re:Why did Clojure gain so much popularity? by pron on Friday April 26, 2019 @12:49PM (#19759446)
> Earlier you complained there was "code that's very unidiomatic" but now you say "writing all the Lisp programs as if they were being written in Java" would be exactly right?

I may have misinterpreted your comment. By "as if they were written in Java" I meant using a similar algorithm. Alternatively, there could be a rule about idiomatic code (enforced by experts), which would compare very different things, but would also be at least somewhat meaningful.

> For some programs

I don't know. Whenever someone refers me to a result on that site that looks weird, I see very different algorithms.

> for some definition of "algorithm".

For a very well-accepted definition of an algorithm in the context of real performance comparisons.

> What is the speed of a programming language?

I'm not sure (although perhaps I could come up with some definition given enough thought), but I didn't make a website that compares languages based on performance. In fact, I said that the website is totally meaningless. But the people behind it may have something in mind, and if they do, they're not telling us. All I can do is think of ways to use the site's data in ways that can at least be meaningful.

Re:Why did Clojure gain so much popularity? by igouy on Friday April 26, 2019 @03:04PM (#19760814)
> … a similar algorithm.

Will someone else look at those similar algorithms and "see very different algorithms"?

> … a result on that site that looks weird, I see very different algorithms.

Do regex libraries for different languages in-fact always implement the same algorithms?

> What is the speed of a programming language? I'm not sure…

You did say "Java outperforms SBCL by a very wide margin -- 1.25-4x faster".

Saying "… so the comparison tells me nothing about the relative speed of those languages" suggests you are looking for something that tells us about "the relative speed" of those languages?

Re:Why did Clojure gain so much popularity? by pron on Friday April 26, 2019 @04:33PM (#19761489)
> Will someone else look at those similar algorithms and "see very different algorithms"?

I would think so.

> Do regex libraries for different languages in-fact always implement the same algorithms?

I don't know. But I do know that when something is presented as an answer, it's good to know what the question is.

> suggests you are looking for something that tells us about "the relative speed" of those languages?

I can think of a couple of ways the two can compare. One is the relative speeds (and other metrics) of programs of a similar nature, written simple idiomatic code. This gives a general "feel" for what kind of workloads different languages may be suitable for. Another is comparing the performance of the compiler/interpreter on some microbenchmark of the same algorithms, preferably written by people who coordinate, and preferably without mixing too many variables (e.g. measuring parallel scheduling separately and regex separately). Either one of these is of some interest.

The benchmark game does neither. If there is some idea behind the site's comparisons, it's certainly keeping it a mystery.

Re:Why did Clojure gain so much popularity? by igouy on Friday April 26, 2019 @08:58PM (#19763064)
> … relative speeds (and other metrics) of programs…

So when you say "the relative speed of those languages" you actually mean the relative speed of programs?

> … programs of a similar nature … preferably without mixing too many variables…

Seems vague, no-longer rigorous.

We can make mystery for ourselves — no one can force us to understand.

Re:Why did Clojure gain so much popularity? by pron on Saturday April 27, 2019 @11:32AM (#19766017)
> So when you say "the relative speed of those languages" you actually mean the relative speed of programs?

No, I mean the relative speed of programs with some carefully chosen relation between them. For example, there is a big difference between "relative income of individuals" and "relative income of social groups," even though the latter could be reduced to the former. Whether a comparison of individuals is meaningful as a comparison of groups depends on how the individuals are chosen and aggregated. Clearly not every choice of individuals would make for a meaningful comparison of groups and not every choice of programs makes for a meaningful comparison of languages. The choices made by the game do not seem at all meaningful for the comparison of languages, but if there is some rhyme or reason to the choice, the website doesn't say what it is.

> We can make mystery for ourselves — no one can force us to understand.

True, but when a website chooses to present data in some aggregate way that seems to defy any familiar forms of aggregation and reasoning without so much as stating what the meaning of the presentation is, it is itself mysterious. I agree that it is possible that the comparisons are not worthless, but without any statement of a hypothesis, it is the most reasonable conclusion. I am sure that the authors of the website would agree that if they don't even attempt to say what the meaning of the comparisons is, even in their own minds, it is reasonable to assume it means nothing.

Re:Why did Clojure gain so much popularity? by pron on Thursday April 25, 2019 @08:54AM (#19747533)
P.S

Browsing some more I see that the binary-trees programs for Java and Substrate -- again, same language -- use completely different algorithms. Not to mention that just the "Java" programs alone use such a weird range of parallelism constructs, that I have no idea whether there was any reason behind it, the programmers simply didn't know about proper parallelism constructs, or the program is so old that it was written before newer constructs were introduced.

Re:Why did Clojure gain so much popularity? by igouy on Thursday April 25, 2019 @12:46PM (#19749946)
Currently, 5 Java binary-trees programs are shown.

The program with the fastest measurements on OpenJDK did not have the fastest measurements on Substrate VM.

Re:Why did Clojure gain so much popularity? by pron on Thursday April 25, 2019 @02:08PM (#19750899)
I understand that, but it still makes the comparison between the two pretty useless. Those are literally two compilers for the same language. I see a comparison of two compilers compiling two very different programs. What does that mean?
Re:Why did Clojure gain so much popularity? by igouy on Thursday April 25, 2019 @02:26PM (#19751099)
It means "The program with the fastest measurements on OpenJDK did not have the fastest measurements on Substrate VM."

Someone with sufficient curiousiy might choose to investigate — Why?

Re:Why did Clojure gain so much popularity? by pron on Thursday April 25, 2019 @04:34PM (#19752249)
> It means "The program with the fastest measurements on OpenJDK did not have the fastest measurements on Substrate VM."

Does it? How do you know that the same programs were run?

Re:Why did Clojure gain so much popularity? by igouy on Thursday April 25, 2019 @07:28PM (#19753493)
Re:Why did Clojure gain so much popularity? by pron on Friday April 26, 2019 @05:15AM (#19755843)
You're right. Picking at random, "Substrate #3" is indeed the same program as "Java #3".