Re:Friendship ended with the garbage collector
by rwmj on Friday August 27, 2021 @06:54AM
(#28326248)
But it's still a better trade off: The programmer can not think about memory management most of the time, but if they want to they can optimize hot paths in the code. Optimization (in all programming languages) often involves complicated and non-intuitive code backed by careful measurement.
[ Parent
| on HN ]
Re:Friendship ended with the garbage collector
by pradn on Friday August 27, 2021 @01:50PM
(#28330891)
Yes, this approach works best with the "premature optimization is the root of all evil" axiom. When I worked on high-performance servers in C#, we would occasionally find ways to 1) reduce allocations 2) make allocations either very short-lived so they stay in the short-term GC timeframe or very long-lived (object pooling/reuse or creating object-aggregates for pseudo-slab allocation).