4 ms·
Using value types for complex objects will reck performance. Why not just use a GCd language at that point?
by lumost 2y ago
Using value types for complex objects will reck performance. Why not just use a GCd language at that point?
- mjburgess 2y agoGiven the amount of cloning and Arc's in typical Rust code, it just seems to be an exercise in writing illegible Go.
- binary132 2y agoIronically Go has pretty clean and straightforward guarantees about when heap allocation happens and how to avoid gc.
- CyberDildonics 2y agoThis is not true, the heavy data will be on the heap and you can move the values around. It actually works out very well.
- germandiago 2y agoYou usually pass around bigger types through the heap internally encapsulated in an object with RAII in C++, for example. I do not think this is low-perf per se.
- lumost 2y agoYes in cpp with raii, rust value types do not work this way to my knowledge.