4 ms·
I believe the main reason for this is that Golang is heavily "value-oriented". Combined with escape analysis it causes most of the short-lived objects to actual
by nicktelford 6y ago
I believe the main reason for this is that Golang is heavily "value-oriented". Combined with escape analysis it causes most of the short-lived objects to actually be allocated directly on the stack.
While the JVM also has escape analysis, because everything is a pointer the chances of an object escaping is considerably higher.
I'm hoping that when Project Valhalla eventually lands, it'll help greatly with allocations and reduce memory pressure even further.