HN Discuss: Golang std performance is outdated
This made me realize that Go was always promoted as "do not use frameworks, do not use libraries, use standard library, everything you need is in there". 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.
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.
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.
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 "market" 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 "stuck" in this "use standard library" 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.
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.
Any time someone brings performance up, it is usually being immediately shut down by the community with the dumb argument of "are you seeing any bottlenecks in your application?". 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.
I even heard that the compiled runtime code handling goroutines is not "pretty". So i getting the impression that Go is becoming stale and might start losing user base going forward. Slowly, but surely.
Any thoughts?
8 comments
[ 4.1 ms ] story [ 30.4 ms ] threadI'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's focus has always been on correctness and flexibility rather than performance.
If performance is your concern, it's always been recommended to reach for other libraries that share that focus.
There's plenty to dislike about the direction Go is moving but stdlib performance isn't one of them. Just find a package that suits you better.
It is taken to extremes on the Gophers Slack.
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.
There is already some effort towards this with encoding/json/v2: https://github.com/go-json-experiment/json
Could you expand on this?