Skip to content

Large file diffs freeze #1686

Closed
Closed

Description

@mib32

Description

When you click on the filename on the left, to look at diff, and if the diff is really large (for example, compiled javascript bundle) the application will freeze for 30-60 seconds.

Version

GitHub Desktop version: 0.5.5

OS version: 10.12.4

Activity

  1. added
    bug
    on May 22, 2017
  2. shiftkey commented on May 22, 2017

    @shiftkey
    Member

    @mib32 to reproduce this locally, could you give an idea of how many lines are in the diff output? If you can give a snapshot of the app at this point I can give you the command to run so I can get an idea of how big the diff is...

  3. mib32 commented on May 22, 2017

    @mib32
    Author

    @shiftkey It is a big single line file with size of 5656581 bytes, that was deleted - so the diff also 5656581 bytes big.
    2017-05-22 15 03 29

  4. shiftkey commented on May 22, 2017

    @shiftkey
    Member

    @mib32 could you open the repository in the terminal, run this command and tell me how many lines it is?

    git diff HEAD --no-ext-diff --patch-with-raw -z --no-color -- public/rzd/build/static/js/main.d899a03f.js.map | wc -l
    

    I think I've got that path right.

  5. mib32 commented on May 22, 2017

    @mib32
    Author

    @shiftkey There's just 8 lines.

  6. shiftkey commented on May 22, 2017

    @shiftkey
    Member

    @mib32 of course, because it's a sourcemap file 🤦‍♂️

    Anyway, that gives me enough to dig into.

  7. shiftkey commented on May 30, 2017

    @shiftkey
    Member

    Looks like we spend a lot of time in updateHeightsInViewport.

    Particularly this line?

  8. veeramarni commented on Jun 5, 2017

    @veeramarni

    Is it because of using codemirror?

  9. self-assigned this
    on Aug 28, 2017
  10. benrondeau commented on Aug 31, 2017

    @benrondeau

    Any update on a solution? Thanks

  11. shiftkey commented on Aug 31, 2017

    @shiftkey
    Member

    @benrondeau I retested this and the issue is still the same. I'm looking into alternative editors but that's going to take time to evaluate accurately due to all the integration we rely on in Codemirror.

  12. benrondeau commented on Aug 31, 2017

    @benrondeau

    If the issue with Codemirror cannot be mitigated quickly, can you add a conditional in the source code which only render certain file sizes (>1mb) or types (.map) if the user wants? This would leave the functionality intact while resolving the UI rendering block

  13. shiftkey commented on Aug 31, 2017

    @shiftkey
    Member

    @benrondeau I've moved that suggestion over to #2596 to discuss further alongside tracking this issue

  14. 8 remaining items

  15. joshaber commented on Oct 23, 2017

    @joshaber
    Contributor

    Yup, as @j-f1 noted I hope the other heuristic will catch minified files. But they are pretty arbitrary, so if it doesn't, let us know and we'll adjust them!

  16. benrondeau commented on Oct 23, 2017

    @benrondeau

    Thanks!

  17. mib32 commented on Nov 26, 2017

    @mib32
    Author

    Why aren't we using Atom.

  18. shiftkey commented on Nov 26, 2017

    @shiftkey
    Member

    Why aren't we using Atom.

    We had some chats with the Atom team about this early in development, and experimented with extracting the relevant bits, but things were too tightly coupled to the rest of the codebase for us to do it in a sane way. But that was ~1yr ago, maybe it's more reusable now?

  19. mourner commented on Nov 26, 2017

    @mourner

    But why use an editor component in the first place? Any comment on this? The diff is read only after all, and diff color highlighting is very simple.

  20. j-f1 commented on Nov 26, 2017

    @j-f1
    Contributor

    Highlight → Split by \n → Render to <DiffLine /> component → Put in groups of n in <DiffChunk /> components in a <List /> (where n is high enough so that the list doesn’t have to manage thousands of elements, but small enough that there won’t be a massive blank space at the bottom of the diff)

  21. shiftkey commented on Nov 26, 2017

    @shiftkey
    Member

    But why use an editor component in the first place? Any comment on this?

    We get a lot of stuff for free from using Codemirror:

    • line selection - while the text isn't editable, the diff control needs to support selecting lines to do partial commits
    • syntax highlighting - this is actually something we didn't support in the classic apps, and Codemirror supports a range of languages in-the-box

    I'm not opposed to improvements around this area, but please keep in mind what is currently supported.

  22. mourner commented on Nov 26, 2017

    @mourner

    @shiftkey CodeMirror seems like a huge overkill for those things, so there's a nice room for improvement here.

  23. shiftkey commented on Nov 26, 2017

    @shiftkey
    Member

    @mourner is this something you're interested in contributing to?

  24. mourner commented on Nov 26, 2017

    @mourner

    Maybe some day. :) I realize this might be a much bigger chunk of work than it seems, just wanted to capture a possible solution in comments.

  25. joshaber commented on Nov 27, 2017

    @joshaber
    Contributor

    CodeMirror also gives us soft wrapping and a path forward if/when we wanna add inline editing (e.g., resolving merge conflicts).

    I'm not thrilled with CodeMirror either, but I haven't seen an alternative that addresses all our use cases yet.

  26. locked as resolved and limited conversation to collaborators on Jul 19, 2018
  27. unlocked this conversation on Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcodemirror

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions