{"action":"created","issue":{"url":"https://api.github.com/repos/vermiculus/magithub/issues/145","repository_url":"https://api.github.com/repos/vermiculus/magithub","labels_url":"https://api.github.com/repos/vermiculus/magithub/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/vermiculus/magithub/issues/145/comments","events_url":"https://api.github.com/repos/vermiculus/magithub/issues/145/events","html_url":"https://github.com/vermiculus/magithub/issues/145","id":263782783,"number":145,"title":"When running into a merge conflict, Emacs hangs if the \"stage changes\" list is long (over 1k)","user":{"login":"NicholasTD07","id":1567035,"avatar_url":"https://avatars2.githubusercontent.com/u/1567035?v=4","gravatar_id":"","url":"https://api.github.com/users/NicholasTD07","html_url":"https://github.com/NicholasTD07","followers_url":"https://api.github.com/users/NicholasTD07/followers","following_url":"https://api.github.com/users/NicholasTD07/following{/other_user}","gists_url":"https://api.github.com/users/NicholasTD07/gists{/gist_id}","starred_url":"https://api.github.com/users/NicholasTD07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicholasTD07/subscriptions","organizations_url":"https://api.github.com/users/NicholasTD07/orgs","repos_url":"https://api.github.com/users/NicholasTD07/repos","events_url":"https://api.github.com/users/NicholasTD07/events{/privacy}","received_events_url":"https://api.github.com/users/NicholasTD07/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2017-10-09T04:20:45Z","updated_at":"2017-10-13T04:44:05Z","closed_at":"2017-10-09T04:56:38Z","author_association":"NONE","body":"I have run into this problem a few times. Whenever I got a merge conflict, and there a a lot files changed (over a thousand, up to 10K), Emacs hangs for a long time (a minute or so) without responding.\r\n\r\nHere's an example:\r\n\r\nThis is the changed files number magit shows after becoming responsive. \r\n\r\n```\r\nStaged changes (1694)\r\n```\r\n\r\nThis is a CPU profile I took by running `profiler-start` and `profiler-report`.\r\n```\r\n- command-execute                                               42098  99%\r\n - call-interactively                                           42098  99%\r\n  - funcall-interactively                                       41758  99%\r\n   - magit-status                                               41753  99%\r\n    - magit-status-internal                                     41753  99%\r\n     - magit-mode-setup                                         41753  99%\r\n      - magit-mode-setup-internal                               41753  99%\r\n       - magit-refresh-buffer                                   41747  99%\r\n        - apply                                                 41690  98%\r\n         - magit-status-refresh-buffer                          41591  98%\r\n          - magit-run-section-hook                              41481  98%\r\n           - run-hooks                                          41481  98%\r\n            - magit-insert-staged-changes                       41248  97%\r\n             - magit-git-wash                                   41242  97%\r\n              - magit-diff-wash-diffs                           41033  97%\r\n               - magit-wash-sequence                            41033  97%\r\n                - #<compiled 0x40d1d4c1>                        41033  97%\r\n                 - apply                                        41032  97%\r\n                  - magit-diff-wash-diff                        40743  96%\r\n                   - magit-diff-insert-file-section              36272  86%\r\n                    - magit-wash-sequence                       36114  85%\r\n                     + magit-diff-wash-hunk                      2680   6%\r\n```\r\n\r\nIs it possible that this is caused by getting and rendering all the changes in all changed files? (and the fact that this list is very long)\r\n\r\nIf it is the case, this might be very naive thinking, but can we change this process so we only get and render the diff when the user expands a file's section in the `Staged changes`? \r\nI mean, can we do this lazily?\r\n\r\nPS.\r\n\r\nThanks for the work you pour into magit. It is now my favorite git client which used to be the command line `git`."},"comment":{"url":"https://api.github.com/repos/vermiculus/magithub/issues/comments/336349026","html_url":"https://github.com/vermiculus/magithub/issues/145#issuecomment-336349026","issue_url":"https://api.github.com/repos/vermiculus/magithub/issues/145","id":336349026,"user":{"login":"NicholasTD07","id":1567035,"avatar_url":"https://avatars2.githubusercontent.com/u/1567035?v=4","gravatar_id":"","url":"https://api.github.com/users/NicholasTD07","html_url":"https://github.com/NicholasTD07","followers_url":"https://api.github.com/users/NicholasTD07/followers","following_url":"https://api.github.com/users/NicholasTD07/following{/other_user}","gists_url":"https://api.github.com/users/NicholasTD07/gists{/gist_id}","starred_url":"https://api.github.com/users/NicholasTD07/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicholasTD07/subscriptions","organizations_url":"https://api.github.com/users/NicholasTD07/orgs","repos_url":"https://api.github.com/users/NicholasTD07/repos","events_url":"https://api.github.com/users/NicholasTD07/events{/privacy}","received_events_url":"https://api.github.com/users/NicholasTD07/received_events","type":"User","site_admin":false},"created_at":"2017-10-13T04:44:04Z","updated_at":"2017-10-13T04:44:04Z","author_association":"NONE","body":"@vermiculus Ooops. Sorry."}}
{"actor":{"display_login":"NicholasTD07"}}