Handle a large amount of text

This PR contains profile optimizations that allow up to 5 million rows of syntax highlighted text to be rendered.