How do you check, if the parameter has been optimized? Do you substract it from itself? If yes, you may want to do an additional clone on the previous version because if you don’t clone it, the variable only holds a reference to this parameter , which means the difference will always be 0.