Show newer

@lupyuen IMHO this article provided an old, boring but cannot-be-wrong conclusion:

the performance (of clone) depends on the actual workload.

The author listed some scenarios they think clone() is better. My knowledge is limited so I can’t comment much. I can say that if the memory-sharing is guarded by terribly designed locks, its performance will be worse than the naive clone() approach

@lupyuen This is very misleading. It highly depends on what you are cloning and how often at runtime (in a hot loop for example?)

Clone while learning or prototyping. Don't get stuck on premature optimization.

But cloning has a performance overhead and you should be aware of that when you want to release your code. Whether that overhead is significant is highly dependent on your specific code.

#RustLang

"all those () `clone()`s added up to no more than a minuscule overhead in real world workloads"

blog.sdf.com/p/fast-developmen

"The Information and Communications Technology sector as a whole is responsible for an estimated 2 to 4 percent of global Greenhouse Gas Emissions. By 2040, that number could reach 14 percent"

spectrum.ieee.org/green-softwa

"Empire of Pain: The Secret History of the Sackler Dynasty" by Patrick Radden Keefe

share.libbyapp.com/title/58526

Show older
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.