Don't compute intraline diffs if the input fails a coarse check for being huge
Don't compute intraline diffs if the input fails a coarse check for being huge

Summary:
Fixes T11744. Because intraline diffs are expensive to generate, we already bail out and decline to generate them for very long lines.

However, we currently split the inputs into lists of characters first, then check how long they are and make a decision to bail. For //huge// inputs (e.g., 1MB+), this is too late: just splitting them has a large CPU/RAM cost.

(These inputs are rare in normal source, but can appear in, e.g., JSON files written without newlines.)

Instead, add an extra "are the inputs really huge?" check first, and bail early if they are.

Test Plan:
  - Generated a 1MB "change a file full of Q to a file full of R" diff.
  - Before change: purged changeset cache; took about 7 seconds to load.
  - After change: purged changeset cache; took about 1 second to load.
  - Viewed some normal diffs to make sure intraline edits still displayed correctly.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T11744

Differential Revision: https://secure.phabricator.com/D16683

fivestars/arcanist,phacility/arcanist,uber/arcanist,chundongwang/arcanist,folsom-labs/arcanist,fivestars/arcanist,r4nt/arcanist,fivestars/arcanist,aik099/arcanist,chundongwang/arcanist,folsom-labs/arcanist,aik099/arcanist,uber/arcanist,Khan/arcanist,r4nt/arcanist,codelabs-ch/arcanist,aik099/arcanist,codelabs-ch/arcanist,codelabs-ch/arcanist,Khan/arcanist,aik099/arcanist,Khan/arcanist,folsom-labs/arcanist,r4nt/arcanist,Khan/arcanist,uber/arcanist,codelabs-ch/arcanist,chundongwang/arcanist,folsom-labs/arcanist,r4nt/arcanist,phacility/arcanist,chundongwang/arcanist,phacility/arcanist,codelabs-ch/arcanist,fivestars/arcanist,phacility/arcanist,uber/arcanist,phacility/arcanist