Home
Blog
Fastest Programming Language
Updated
Dot Net Perls

Fastest Programming Language

Some years ago I had a C# program that was taking too long to finish. The time required for it to finish processing was approaching a minute. For an interactive program, this was not acceptable, so I focused on optimizing the program.

Eventually I added multi-threading to the program, and it finished in less than 100 milliseconds. However, I was still curious as to whether other languages, like Go or Rust, could be faster than C#.

I ported the program to Go, and although I changed the algorithms a bit to be more efficient (this often happens when porting) the program was at least 20% faster, even without any optimization-specific work. The Go program took 80 milliseconds to finish.

Finally, I ported the Go program to Rust, and surprisingly this version was not only plagued with fewer bugs (it worked correctly right away), but it also was twice as fast as the Go version, at 40 milliseconds.

In the comparison of C#, Go and Rust, I found that C# and Go were similar, although Go was faster for command-line programs as it was compiled ahead-of-time. Rust meanwhile was the fastest programming language to use, and this was before any optimization work was done—it was just the first compiling version.

Dot Net Perls is a collection of pages with code examples, which are updated to stay current. Programming is an art, and it can be learned from examples.
Donate to this site to help offset the costs of running the server. Sites like this will cease to exist if there is no financial support for them.
Sam Allen is passionate about computer languages, and he maintains 100% of the material available on this website. He hopes it makes the world a nicer place.
An RSS feed is available for this blog.
Home
Changes
© 2007-2025 Sam Allen