Skip to content

Improve handling of extremely large text files #960

@AHSauge

Description

@AHSauge

When an excessively large file is loaded in, a few things happen

  1. RAM usage spikes
  2. If it's large enough, we get QWidget::setMinimumSize: (/QWidget) The largest allowed size is (16777215,16777215)
  3. Not possible to stage individual lines or sections (an issue irrespective of size)
  4. Probably slow-downs on HDDs, low-end SSDs or other generally low-speed storage devices

It's been suggested a few places to not load or render large files by default. I would suggest to make the threshold a user setting that is default set to 1MiB and 10k lines. Instead of rendering the file, we'll display GUI allowing the user to load the diff anyway. Separate from that, I would suggest to place an upper limit on how large a diff can be when it's viewed so that the GUI isn't broken (point 3).

A side note here, and I didn't look into this, is that it might be that libgit2 changes are necessary to optimise this. If we decide not to render the diff, there's also no reason to load the blob for the diff. Thus, we need to make sure that we only load metadata for those cases.

Relevant to #303

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions