Eliminate unnecessary memory copies.