news.volyx.in

A high-speed network driver written in C, Rust, Go, C#, Java (github.com)

444 points by Sindisil · 2593 days ago · 163 comments on HN

Article summary

The article discusses a high-speed network driver written in multiple programming languages, including C, Rust, C++, Go, C#, Java, and others. The driver is designed to show that writing a fast network driver can be simple and is an educational tool. The driver's performance is benchmarked and compared across languages, with some languages performing better than others in certain scenarios. The results show that C# and Rust are among the top performers in terms of throughput and latency.

Main themes

  • network drivers
  • programming languages
  • performance comparison
  • high-speed networking
  • language benchmarks

What commenters say

  • C# is surprisingly performant in the benchmark, possibly due to its new low-level memory types and support for hardware intrinsics.
  • Rust's performance is slightly slower than C due to bounds checking, but this difference may be due to the compiler used rather than the language itself.
  • The comparison between languages is not always fair, as some implementations may be more optimized than others, and the results may not reflect real-world scenarios.
  • Go's performance is comparable to C# in terms of throughput, but it has better latency in some cases.
  • The .NET CLR has made significant performance improvements in recent years, surpassing the JVM in some benchmarks.
  • The use of 'unsafe' code in Rust may be necessary in some cases, but it can also impede optimization and make bounds checking more difficult to eliminate.
  • The benchmark results are not necessarily representative of real-world performance, and other factors such as development time and ease of use should also be considered.