I've seen a lot of questions about what is shallow vs deep copy, but not a lot on when to use each. If deep copy is safer, why aren't more developers deep copying every single object every time something is changed? If that were done, doesn't performance become an issue? Is there ever a good time to shallow copy?
Edit - This question is not a duplicate of the one provided. That question asks what is the difference between the two. This question is asking in what scenario is it appropriate to use each one, I understand the differences.
Edit - The question is if a server is receiving requests and adding or modifying one field, should the server map the json request to object, then map every single field from that object to new objects with the one field modified then forward the request to a second api? Or is a shallow copy sufficient since there's not really a chance of the original object being modified?