Optimize vector.