4 ms·
GC is often faster than ownership. All the extra clones are costly.
by amedvednikov 3y ago
GC is often faster than ownership. All the extra clones are costly.
- _ahxg 3y agoThat's a fair point, although there is a simple solution in Rust (and other RAII languages) to use heap allocation if what you want is moving big chunks of data (so only the pointer is moved) or in case you really want copies, reference counting (Rc/Arc in Rust).
- thumbuddy 3y agoYou don't have to clone... Really you don't. If you want fast rust code, learning how to avoid that is probably step 1.