2 ms·
They might want to add some motivation for this, I have no clue why they are obsessing over how copying works, aren't there more important things to focus on?
by TinkersW 4y ago
They might want to add some motivation for this, I have no clue why they are obsessing over how copying works, aren't there more important things to focus on?
- NobodyNada 4y agoBeing in control of object lifetimes makes a huge difference for performance-critical code. Swift’s approach to performance is “give everything an almost Python-like level of dynamism, then aggressively inline and optimize everything that’s statically known”. But this can be problematic when you know more about your object lifetimes than the compiler does. I switched to Rust for most of my personal projects because I was working on something performance-sensitive and got really, really tired of finagling my code to try to convince the optimizer to hoist some retain/release call out of a tight loop.