3 ms·
It depends on workload. It is difficult to quantify the trade offs without knowing that. The problem is in languages like C#/Java almost everything is an alloc
by nu11ptr 1y ago
It depends on workload. It is difficult to quantify the trade offs without knowing that.
The problem is in languages like C#/Java almost everything is an allocation, so I don't really think reference counting would work well there. I suspect this is the reason PyPy doesn't use reference counting, it is a big slowdown for CPython. Reference counting really only works well in languages with low allocations. Go mostly gets away with a non-compacting mark-sweep collector because it has low level control that allows many things to sit on the stack (like Rust/C/C++, etc.).
- adgjlsfhk1 1y agoC# is a lot better than Java on this front since they support stack allocated structs