There a project to benchmark programming language performance: https://github.com/attractivechaos/plb2 • Might be interesting for someone to code up a Clojure implementation (if anyone feels like it!). I assume it should be able to perform just as well as Java (although it may not look very idiomatic e..g. using Arrays instead of vectors etc). • Java does very well in this table. • Python is still embarassingly far behind in this table.
> I don't know anyone who would write java like this lol A compiler? 😄
I'm interested in how Java will perform if the code was run several times. Could even be better
these benchmarks seem to be focusing on very specific kinds of programming. i realize the goal is to compare the same algorithm across languages, but I don't know anyone who would write java like https://github.com/attractivechaos/plb2/blob/master/src/java/nqueen.java lol
Yeah it's certainly not idiomatic - but I think it's a reasonable style of Java code for writing very high performance methods.
Similar in style is the Computer Language Benchmarks Game, which for a few years included Clojure versions of its programs, but not any more. Very non-idiomatic programs in most of the languages represented, where people tweaked the implementation as much as possible to reduce compute time: https://benchmarksgame-team.pages.debian.net/benchmarksgame/
Some Clojure code that I wrote, and even better ones by Alex Miller, should still be in this old repo: https://github.com/jafingerhut/clojure-benchmarks
fun to see the old-style metadata in that code