news.volyx.in

Why are my Go executable files so large? (cockroachlabs.com)

468 points by caiobegotti · 2480 days ago · 330 comments on HN

Article summary

The article discusses the large size of Go executable files, with the author's project CockroachDB having a binary size of 123MB. The author built a tool to visualize the contents of the executable file and discovered that the size is largely due to the compiled code and runtime libraries. The article explores the reasons behind the large size and potential solutions. The author's goal is to reduce the binary size to improve performance and distribution.

Main themes

  • binary size optimization
  • Go language and runtime
  • enterprise application development
  • performance and scalability
  • dependency management
  • static linking and compilation
  • runtime libraries and overheads

What commenters say

  • Some commenters argue that large binary sizes are not a significant issue due to the low cost of disk space and data transfer.
  • Others counter that large binary sizes can still have a significant impact on performance, especially in long-running applications with large amounts of data.
  • There is disagreement over whether the Go language and runtime are optimized for large-scale enterprise applications.
  • Some commenters suggest that static linking and lack of dependency management contribute to large binary sizes.
  • Others propose that tree shaking and AOT compilation could help reduce binary sizes.
  • The importance of startup time and runtime performance is debated, with some arguing that these are not critical factors for server applications.
  • The need for better tooling and optimization techniques for reducing binary sizes is acknowledged by many commenters.