Describe a time you had to optimize a piece of code that was performing poorly in a production environment.