TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

HN Discuss: Golang std performance is outdated

6 pointsby indulona7 months ago
There have been some http performance tests done on youtube recently, comparing various languages and Go was losing badly to Rust and Zig and Odin(or not doing as good against Node as one would expect). Yes, they do not have GC and are expected to perform better, but they were outperforming Go, which was made with networking being of highest importance in mind, by almost 2x in some cases when it comes to rqs and cpu and memory even worse. And the only true competitor is c# due to having runtime and GC, which is sparsely tested so not relevant to the conversation.<p>This made me realize that Go was always promoted as &quot;do not use frameworks, do not use libraries, use standard library, everything you need is in there&quot;. Which is 100% true and is good in principle, but Go has been around for a long time now and looking back, beside some GC optimizations about 5 years ago, there has not been anything done for performance, only security and big fixes.<p>When we look at popular http frameworks and routers like fiber, gin or fasthttp, serialization like goccy json(also used in kubernetes), compression like klauspost or synchronization like puzpuzpuz, or gnet networking, we can clearly see that libraries are now outperforming the standard library by tens and hundreds of percent. The standard library simply fell behind and has been stuck in 2014.<p>This is a problem because, as I have mentioned, Go promotes standard library over external ones, and that works perfectly fine because the standard library is very rich and indeed has all you probably need, but that also means that very high percentage, or even near all, of the code out there is being throttled by this outdated performance of standard library.<p>In short, other languages are leaving Go behind because they use classic approach of preferring to use external libraries over the standard library, and development in that &quot;market&quot; is moving forward really fast. All the new theories and discoveries are being implemented in short time and pushed into production. That is not the case with Go. Because Go developers are &quot;stuck&quot; in this &quot;use standard library&quot; mindset and and so they will not change this philosophy for new projects and new developers will not adopt it because everyone else is using standard library. So there can be no progress in this manner.<p>Go has recently got a new team lead who discussed his focus on improving the performance of GC, which is great. But the large standard library itself is still not being talked about when it comes to performance.<p>Any time someone brings performance up, it is usually being immediately shut down by the community with the dumb argument of &quot;are you seeing any bottlenecks in your application?&quot;. The mentality that there should be no focus on performance until it is too late is cancer that the Go community has been riddled with for quite some time.<p>I even heard that the compiled runtime code handling goroutines is not &quot;pretty&quot;. So i getting the impression that Go is becoming stale and might start losing user base going forward. Slowly, but surely.<p>Any thoughts?

3 comments

wild_egg7 months ago
&gt; This made me realize that Go was always promoted as &quot;do not use frameworks, do not use libraries, use standard library, everything you need is in there&quot;.<p>I&#x27;ve been writing Go since 2012 and have no idea where you picked up this sentiment. The stdlib is there to give you many useful capabilities but it&#x27;s focus has always been on correctness and flexibility rather than performance.<p>If performance is your concern, it&#x27;s always been recommended to reach for other libraries that share that focus.<p>There&#x27;s plenty to dislike about the direction Go is moving but stdlib performance isn&#x27;t one of them. Just find a package that suits you better.
评论 #41828047 未加载
评论 #41828095 未加载
hckrofalltrades7 months ago
I would like to see those benchmarks that are being conducted. Care to share a link?<p>Regardless, there is definitely acknowledgement within the community that some parts of the standard library could use a rethink based on lessons learned in the past decade.<p>There is already some effort towards this with encoding&#x2F;json&#x2F;v2: <a href="https:&#x2F;&#x2F;github.com&#x2F;go-json-experiment&#x2F;json">https:&#x2F;&#x2F;github.com&#x2F;go-json-experiment&#x2F;json</a>
评论 #41828107 未加载
neonsunset7 months ago
&gt; the only true competitor is c# due to having runtime and GC, which is sparsely tested so not relevant to the conversation.<p>Could you expand on this?