Loop optimization is transforming a loop in a way that improves performance without changing the output. Because many transformations come at the cost of maintainability and readability, often this is best left to a compiler.