Live data from Hacker News

Benchmarking 20 programming languages on N-queens and matrix multiplication

github.com

111–120 of 194 posts

Re: Benchmarking 20 programming languages on N-queens and matrix multiplication

#111

I think this shows the value of programmer productivity over performance at all costs. Python is one of the most popular languages despite having performance issues for complex algorithms. Users value clarity and ease of expression over performance. That's why Python is primarily used a glue code in these complex tasks.

[deleted]

Re: Benchmarking 20 programming languages on N-queens and matrix multiplication

#112

I think this shows the value of programmer productivity over performance at all costs. Python is one of the most popular languages despite having performance issues for complex algorithms. Users value clarity and ease of expression over performance. That's why Python is primarily used a glue code in these complex tasks.

[deleted]

Re: Benchmarking 20 programming languages on N-queens and matrix multiplication

#113
post #27

Why not run C# as AOT? It’s a one line change.

Do people usually run C# code AOT compiled?

I don't know about people but I do pretty much every where I can. I make such a difference that AWS is heavily investing on lambdas that uses AOT[0].

[0] - https://docs.aws.amazon.com/lambda/latest/dg/dotnet-native-a...

Re: Benchmarking 20 programming languages on N-queens and matrix multiplication

#114
Nowadays I would add lines of code and syntax complexity to the benchmark. It is apples and oranges comparison but you could prefer clarity than performance depending on the circumstances. Also, it is relatively easy to do with today language tools.

Re: Benchmarking 20 programming languages on N-queens and matrix multiplication

#115

Earlier quoted context omitted.

The rust code is very unidiomatic, not only because of the Vec of Vecs which I’d say, even if it’s the obvious naive approach, no one experienced wouldn’t choose over a flat slice, the implementation itself is very naive and unidiomatic.

Also it's using checked indexing, which apart from being not idiomatic, is also going to slow things down. A fairer comparison would be to use the unchecked indexing variants.

Unchecked indexing is unidiomatic. A more fair comparison world be using iterators if possible but otherwise you have to live with that.

Re: Benchmarking 20 programming languages on N-queens and matrix multiplication

#116
post #10

> ” Timing on Apple M1 Macbook Pro” Given that its become increasingly more common for CPUs to have both Performance & Efficency cores … how do benchmarks ensure they are only being run on the P-cores?

Sibling answered on macOS. Their scheduler prefers by default to run everything on performance and reserves efficiency for background OS tasks by default. On Linux you could set the affinity when running by pinning the cpu affinity either upfront through task set or programmatically at runtime (eg I have 32 cores and 0-15 are performance while the rest are efficiency)

Re: Benchmarking 20 programming languages on N-queens and matrix multiplication

#117
A benchmark I would like to see is a comparison of languages in terms of how fast they are to beginners vs experts. I've been thinking about how to design it to get that result. What I think would work is taking something like these simple puzzles and have maybe a hundred people write up different solutions, so we can compare them using the programmer's level of expertise as one of the factors.

Re: Benchmarking 20 programming languages on N-queens and matrix multiplication

#118

Aren’t JIT languages at a disadvantage since they are benchmarked through the CLI rather than using a benchmarking library to allow JIT to warmup?

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.

0.3s is significant for a task that only takes 1.14s

Re: Benchmarking 20 programming languages on N-queens and matrix multiplication

#120
post #2

I would expect Mojo to perform better in these settings.

Mojo is on the list and performed well. Have a look

its 2x slower than C in matmul which is something I wouldn't expect mojo to be slow at
Post reply on HN