3 ms·
The JVM can relocate memory to avoid fragmentation. Rust can't, at least natively. Are they not worried about this regression?
by karl_p 1y ago
The JVM can relocate memory to avoid fragmentation. Rust can't, at least natively. Are they not worried about this regression?
- geodel 1y agoWell Java need it because it fragments memory a lot. With Rust one has value types and stack allocation which takes care of one of the biggest cause of fragmentation.
- kikimora 1y agoWriting code that would not fragment memory over time is arguable much harder than writing GC friendly code.
- geodel 1y agoYeah, cooking food in kitchen is much harder than having it delivered from restaurant at doorstep. Reasonable people will see if cost makes it worthwhile.
- tigy32 1y agoI haven't found that to be the case in my experience: just for example in java you tend to end up with essentially a lot of `Vec<Box<Thing>>` which causes a lot of fragmentation. In rust you tend to end up with `Vec<Thing>` where `Thing`s are inlined. (And replace Vec with the stack for the common case). I find it more like Java is better at solving a problem it created by making everything an object.
- mrkeen 1y agoWith 10x the throughput (TPS) and the lack of GC pauses (which were the cause of the rewrite), how would they measure such a regression, let alone worry about it?