news.volyx.in

The One Billion Row Challenge in Go: from 1m45s to 4s in nine solutions (benhoyt.com)

499 points by nalgeon · 897 days ago · 191 comments on HN

Article summary

The article discusses the author's attempt to solve the One Billion Row Challenge in Go, a task that involves processing a large text file with weather station data. The author presents nine solutions, each faster than the previous one, with the fastest solution taking 3.4 seconds to process the data. The solutions involve optimizations such as using a custom hash table, parsing temperatures by hand, and parallelizing the processing. The author also compares their results to other solutions in Java and C#.

Main themes

  • Performance optimization
  • Programming languages
  • Go language
  • Java vs Go
  • C# performance
  • Parallel processing

What commenters say

  • The Java version of the solution is faster than the Go version due to additional optimizations.
  • The Go language is incapable of accessing certain optimizations present in Java or C#/C++/Rust due to its lack of SIMD API and weaker compiler.
  • The JVM can perform guided optimizations at runtime, which can result in better performance than native executables.
  • C compilers can also optimize code effectively, and the resources spent compiling the code are amortized to effectively zero, whereas JIT engines bear this cost at every program startup.
  • The introduction of Native AOT in .NET has changed the landscape of optimization, allowing for more efficient use of resources and better performance.
  • The choice of programming language for a task should be based on the specific requirements and constraints of the task, rather than general assumptions about the language's performance capabilities.