3 ms·
Recently I rewrote a medium sized Websocket app from Node to Go. Hoping for better performance and having heard a lot of good about Go. Since the application r
by zongitsrinzler 11y ago
Recently I rewrote a medium sized Websocket app from Node to Go. Hoping for better performance and having heard a lot of good about Go.
Since the application relies heavily on sharing resources between sockets I found out the hard way that concurrent programming in Go is not much easier than in Java. Sure, it has a better syntax and channels but compared to Node where you never have to think about things like these the complexity is way higher.
Long live Node.js!
- 59nadir 11y ago> Since the application relies heavily on sharing resources between sockets... Which resources?
- zongitsrinzler 11y agoConnections are grouped in various ways. A lot of maps, etc. You can't even use a regular int safely, need to use an atomic for that. I'm not bashing Go here, the memory usage is about 3x lower (which was the most important for me). And for a static language it's pretty cool.
- 59nadir 11y agoAm I understanding you correctly when I assume that you mean you share data across threads?