How can I improve the performance of this code?

Printable View