When an origin-destination (OD) cost matrix analysis is solved iteratively in a script using the same OD cost matrix analysis layer, the performance of adding a location and solving the matrix slows down with every iteration until the OD cost matrix analysis layer is deleted and created again.