Description
When writing to an Array using methods such as Array.set, we read the existing value and drop it before the write. For types that are copy (e.g. Int) this is redundant and a waste of CPU time.
We should optimize this such that for copy types we don't perform a read, instead just overwriting the data as-is. Ideally this is implemented in a generic way that works for other types as well. This probably means we need to look for reads of Pointer[T] values where T: copy, then remove such reads if their result isn't passed around. This in turn may depend on some form of lifetime/escape analysis that we'd likely also need for #776
Related work
No response