Don't grind to a halt when encountering files with very long lines.
Review Request #3178 — Created July 5, 2012 and submitted — Latest diff uploaded
Don't grind to a halt when encountering files with very long lines. Files with very long lines would cause Review Board to sit processing for a very, very long time. This happened both when styling the orig/modified files using Pygments (which operates per-line, and is really slow when there's just one giant line), and when attempting to highlight changes between replaced lines. Now we determine if there's a line over our limit (set to 1000 characters). If so, we turn off pygments, and we don't highlight changes for that line (if it's a "replace"). This helps a great deal when people are putting up minified JavaScript/CSS or large single-line data sets up for review.
Tested this against a change that had a 800KB line, which basically forever blocked an Apache worker process when accessed. The diff, instead of never loading and causing 100% CPU spikes until killed, loaded in just a few seconds.