What is this supposed to demonstrate? There appears to be roughly the same code structure, ported to every language, while for some languages, arbitrary optimizations are introduced (such as using `array` instead of `list` in Python). But nobody working in Python uses matrix multiplication code written in Python. They use NumPy, which is a de facto standard library for people working in the relevant fields. It's as m…
Benchmarking 20 programming languages on N-queens and matrix multiplication
51–60 of 194 posts
Re: Benchmarking 20 programming languages on N-queens and matrix multiplication
#52Glad to see dart in there, it's normally overlooked. Not a bad result. I wonder what speed it would be if it had been AOT compiled instead of JIT.
Re: Benchmarking 20 programming languages on N-queens and matrix multiplication
#53Earlier quoted context omitted.
Generally, the point of language benchmarks is to show how the languages compare at solving the same problem, without external libraries. Including external libraries is pointless since any language can call any library, ultimately, so at best you'd be comparing the FFI overhead. So this shouldn't be taken as "how fast does a real-world Python program do at matrix multiplication", since of course no one writes real-w…
> But it can show the relative speed of pure Python at purely computational tasks. But that's irrelevant if nobody uses "pure Python" for computational tasks. It's like asking "how well do these languages run on a Lisp machine from 1979?". It simply has no relevance to real-world considerations today.
Re: Benchmarking 20 programming languages on N-queens and matrix multiplication
#54Maybe I made an accidental optimization in my language translation, or maybe there are some operations that are much slower in JS and these benchmarks didn't hit any of them.
Re: Benchmarking 20 programming languages on N-queens and matrix multiplication
#55Earlier quoted context omitted.
Yes, but the author claims the longest JIT warmup is 0.3 seconds, so it's not an important issue in these benchmarks that take several seconds.
I strongly suspect that the author may have confused the JIT warmup (hard to measure, as you need to ensure that the performance figure have reached the stable point) from the startup overhead (easy to measure).
Re: Benchmarking 20 programming languages on N-queens and matrix multiplication
#56Re: Benchmarking 20 programming languages on N-queens and matrix multiplication
#57Re: Benchmarking 20 programming languages on N-queens and matrix multiplication
#58Surprised how well JS (node and others) seem to come out when I've had firsthand experience of switching from JS to Go to speed up an algorithm type question and had the Go version crank through a bruteforce much much faster. Maybe I made an accidental optimization in my language translation, or maybe there are some operations that are much slower in JS and these benchmarks didn't hit any of them.
Re: Benchmarking 20 programming languages on N-queens and matrix multiplication
#59Earlier quoted context omitted.
IMO, uncompressed bytes is a better representation, because it can be used to compare relative expressive power for the particular problem. I'd bet Python cleans house here, but the write-only languages are a wild card.
Why would uncompressed bytes be better? Using a good compression algorithm better approximates the statistical entropy of the code which is at least correlated with e.g., Kolmogorov complexity.
Re: Benchmarking 20 programming languages on N-queens and matrix multiplication
#60Aren’t JIT languages at a disadvantage since they are benchmarked through the CLI rather than using a benchmarking library to allow JIT to warmup?
What's CLI?