|
|
|
|
|
by likeliv
2423 days ago
|
|
> most of those languages (1) have a GC that makes boxing a much cheaper operation than in Rust Why is that? I would intuitively think it is the other way. (Is a malloc/free pair not cheaper than an allocation on the GC heap + collecting its garbages?) |
|
It's always about details though. If a GC is faster than malloc/free, but your language doesn't tend to allocate much to begin with, the whole system can be faster even if malloc is slower. It always depends.