Hacker News new | ask | show | jobs
by shpx 99 days ago
I want to quit Magit because it's unbearably slow. In a repo with 6000 files `git status` takes 100ms but the Magit equivalent takes 2-4 seconds.
3 comments

This will probably help:

    ;; Speed up magit status by removing some things
    (remove-hook 'magit-status-sections-hook 'magit-insert-tags-header)
    (remove-hook 'magit-status-sections-hook 'magit-insert-status-headers)
    (remove-hook 'magit-status-sections-hook 'magit-insert-unpushed-to-pushremote)
    (remove-hook 'magit-status-sections-hook 'magit-insert-unpulled-from-pushremote)
    (remove-hook 'magit-status-sections-hook 'magit-insert-unpulled-from-upstream)
    (remove-hook 'magit-status-sections-hook 'magit-insert-unpushed-to-upstream-or-recent)
It's because Magit is doing a lot more than just status. It executes multiple git commands to get all the information it wants to display.

As a sibling said, you can disable much of that.

Profiling[1] your own repository and tweaking as necessary (possibly disabling auto-status refresh) will likely yield significant performance improvements.

I use magit with a very large repository (100k files, millions of commits) it's still not lightning fast like it is with smaller repositories, I'm still finding it an improvement over the CLI.

My config notes this saves me ~13 seconds in git-status

  (remove-hook 'magit-status-headers-hook 'magit-insert-tags-header)
[1]: https://docs.magit.vc/devel/magit/Performance.html