testing and optimizing performance