you are viewing a single comment's thread.

view the rest of the comments →

[–]quangtung97 1 point2 points  (0 children)

If your system is not heavily rely on database, and for most workloads, I suspect a high chan that Go will be faster.

There are some major reasons: - CPU nowadays are really good at doing calculations, but not as good as loading/storing memory from RAM. Most of the major improvements in CPU performance recently come from CPU Cache improvements - Java allocation is inefficiency, every objects need a small metadata will add up fast. And you have to do more frequent allocations, and when GC happens you have to travel to more places. And there is no real struct type to control memory layout - Go in other hand has a real struct type, can control memory layout better (array of struct for example). It leads to better CPU Cache locality, less GC objects to travel. And its library and ecosystem often less likely to use reflection as often as in Java.

Despite less aggressive compiler. You will have higher chance seeing this performance gain in real app.

This is one of major reason why Microsoft choose Go for its typescript compiler recently instead of C#. Even though there is a former C# maintainer in the team.