Repository navigation
Add more diff size limits - #3032
Merged
Merged
Conversation
shiftkey
self-requested a review
October 18, 2017 22:52
niik
requested changes
Oct 23, 2017
| if (!isValidBuffer(buffer)) { | ||
| return true | ||
| } | ||
|
|
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Contributor
Author
|
🐸 |
niik
approved these changes
Oct 23, 2017
Merged
Contributor
|
@joshaber I'm still encountering slow diffs on some files. The max line length of 500,000 seems pretty high (mine has lines 111,000 chars long and takes 15s to diff and syntax highlight). I would argue that any file that has lines of over a few hundred chars is not handwritten, but probably minified. Perhaps a limit of 1000-10,000 chars per line would be better? |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2596
This introduces two more limits:
Both of those are pretty arbitrary, determined by testing what felt slow on my computer 😬 We can tweak them based on feedback.
I created test files with
base64 /dev/urandom | head -c 10000000 > file.txt.I didn't implement the ability to show the diffs anyways. Given that that experience means the app freezes, I'm not sure we wanna allow that without taking a harder look at diff rendering performance.