Which Programming Language Is The Fastest?

Thoughts from a test project

分享
Which Programming Language Is The Fastest?
Photo by Tim van der Kuip on Unsplash

@BenjDicken add a test to execute a two-tiered loop, 10,000 * 100,000 = 1,000,000,000,000 loops, to see which programming language is faster. A motion graphic of the test was created to visualize this.

Speed of execution of fib in different languages
https://x.com/BenjDicken/status/1861811963434770665

Actually, the best part of this kind of program is the ISSUE. Enthusiastic developers contribute versions in various languages, such as Zig, Julia, Perl, Elixir, Fortan, C#, Lua

Also, there are discussions on how to optimize the code.

For Example :

@dolanor mentions a PR # optimize go loops with goroutine, arguing that Golang's strength is in concurrent programming; it's not as efficient as C or Rust in a single thread, and should be optimized with goroutine.

@Brandon-T In # Benchmark Issues, we discuss the problems of existing benchmarks and the direction of improvement. The core idea is that tests should not include extraneous time such as program startup, printing, etc., but should focus on the code execution.

Unconsciously, I almost finished reading the whole issue.

This project reminds me of 1BRC from earlier in the year. It was a great diversion from the boring life of coding. I also learned some performance optimization techniques and participated in discussions with people from all over the world.

I wish there were more events like this.

Update:

I found another blog today: How Much Memory Do You Need in 2024 to Run 1 Million Concurrent Tasks?