1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-09 00:12:40 +01:00
phorge-arcanist/src
epriestley 2ad15c499a 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
2016-10-07 07:42:19 -07:00
..
__tests__ Use PhutilLibraryTestCase 2015-01-07 07:37:59 +11:00
configuration Remove command spelling correction from Arcanist 2016-07-27 09:35:28 -07:00
difference Don't compute intraline diffs if the input fails a coarse check for being huge 2016-10-07 07:42:19 -07:00
differential Extend from Phobject 2015-06-15 15:47:33 +10:00
docs/book Minor documentation improvements 2015-06-08 11:31:35 +10:00
events/constant Remove @group annotations 2014-07-09 09:12:13 +10:00
exception pht all the things 2015-05-13 21:00:53 +10:00
extensions Changes to Arcanist for libphutil "extensions/" 2013-04-22 14:38:49 -07:00
hgdaemon Extend from Phobject 2015-06-15 15:47:33 +10:00
internationalization Various translation improvements 2015-11-02 21:31:04 +11:00
land Use --no-ext-diff in arc land call to git diff 2016-08-06 09:00:01 -07:00
lint Check both UNIX- and Windows-style paths from linter output 2016-09-21 14:29:42 -07:00
parser Update documentation for changed splitGitDiffPaths function 2016-08-19 14:55:33 -07:00
repository Correctly parse file renames and copies from git diff --raw 2016-08-16 17:27:20 -07:00
unit Filter out some Clover coverage to prevent false positives 2016-02-24 12:58:07 -08:00
upload Fix handling of View Policy in CLI upload workflow for small, unique files 2016-08-17 09:04:01 -07:00
workflow Added a warning prompt if the user tries to use an API cert instead of a CLI cert 2016-08-25 11:34:34 -04:00
workingcopyidentity Extend from Phobject 2015-06-15 15:47:33 +10:00
__phutil_library_init__.php Delete license headers from files 2012-11-05 11:16:24 -08:00
__phutil_library_map__.php Remove command spelling correction from Arcanist 2016-07-27 09:35:28 -07:00