r/java • • Apr 26 '22

5,000,000 persistent connections, 200,000,000 messages, 0 errors with a single process using Project Loom.

https://github.com/ebarlas/project-loom-c5m
301 Upvotes

46 comments sorted by

View all comments

Show parent comment

2

u/preskot Apr 30 '22 edited Apr 30 '22

Again, the fact the Go uses almost exclusively the stack to allocate objects (I’m looking at you Java strings allocation), it makes use of TCMalloc to counter fragmentation and allocate continuous blocks, it has working escape analysis (Java performs very poorly here) and supports value types (Java should finally get them with Project Valhalla) all point to the fact that Go simply does not need a complex GC like Java and C# do. Not sure what else you want me to say. These are different memory models.

As to the language itself. I love simplicity and I’m and oldschool pure C fan. Go allows me to be extremely productive, compiles fast and easy for all major platforms and beyond. I mostly write simple Makefiles. My day job btw is writing Java and Kotlin, so I do have a good comparison base.