[-] Camille@lemmy.ml 1 points 7 months ago

Well, if your compiler knows the old value is unused afterwards, it can just modify the parameters you want and return the object as is. And if you're really manipulating non-mutable objects, shallow copies should be enough to replicate an object + a few modifications. I don't have everything in mind but once the semantics of your program has been checked by the compiler and it starts emitting lower-level code, it can cheat a lot to optimize things out

view more: ‹ prev next ›

Camille

joined 10 months ago