>

OSX El Capitan에서 Magit 20171026.217, Git 2.10.1 (Apple Git-78), Emacs 25.1.1, darwin을 사용하고 있습니다.

CentOS Release 6.6에서는 Magit 20180903.2339, Git 2.13.1, Emacs 26.1, gnu/linux를 사용하고 있습니다.

동일한 40MByte git repo의 경우 magit 상태 버퍼는 Linux에서 4 초가 필요하지만 Mac OS에서는 0.5 초만 필요합니다. 리눅스 리포지토리에서 한 파일에서 한 줄만 변경되었습니다.

CentOS에서 내 .emacs에는 magit 성능 페이지 및 다른 곳에서 다음 명령이 포함되어 있습니다.

   ;; https://magit.vc/manual/magit/Performance.html
    (setq magit-refresh-status-buffer nil)
    (setq magit-diff-highlight-indentation nil)
    (setq magit-diff-highlight-trailing nil)
    (setq magit-diff-paint-whitespace nil)
    (setq magit-diff-highlight-hunk-body nil)
    (setq magit-diff-refine-hunk nil)
    (setq magit-revision-insert-related-refs nil)
    (remove-hook 'magit-refs-sections-hook 'magit-insert-tags)
    (remove-hook 'server-switch-hook 'magit-commit-diff)
    (setq vc-handled-backends nil)
    (setq auto-revert-buffer-list-filter
          'magit-auto-revert-repository-buffers-p)
    ;; https://williambert.online/2015/11/How-I-made-Magit-fast-again/
    (setq magit-commit-show-diff nil)
    (setq magit-revert-buffers 1)
    (setq magit-refresh-verbose 1)

이 코드를 사용하여 리눅스와 macOS에서 magit-status를 프로파일 링했습니다 :

   (defun profile-magit ()
      (elp-instrument-package "magit")
      (elp-reset-all)
      (magit-status "pathToRepo")
      (elp-results))
    (profile-magit)

결과는 다음과 같습니다. 먼저 CentOS (나쁜)와 MacOS (나쁜)에 대한 것입니다.

CentOS 성능 향상에 대한 제안은 대단히 감사합니다.

CENTOS에서의 결과 생성 (매우 느림) :

   magit-status                                      1           4.637725058   4.637725058
    magit-run-section-hook                            2           4.633367778   2.316683889
    magit-process-file                                26          4.408109038   0.1695426553
    magit-status-internal                             1           4.3173727809  4.3173727809
    magit-mode-setup                                  1           4.317356942   4.317356942
    magit-mode-setup-internal                         1           4.31735279    4.31735279
    magit-refresh-buffer                              1           3.95782774    3.95782774
    magit-status-refresh-buffer                       1           3.957227878   3.957227878
    magit-git-insert                                  13          2.124903824   0.1634541403
    magit-git-str                                     23          1.4826771669  0.0644642246
    magit-insert-status-headers                       1           1.127880501   1.127880501
    magit-rev-parse-safe                              20          1.093782861   0.0546891430
    magit-insert-unpushed-to-upstream-or-recent       1           1.082952769   1.082952769
    magit-git-string                                  14          1.0594253679  0.0756732405
    magit-insert-headers                              1           0.982247303   0.982247303
    magit-git-wash                                    4           0.82460503    0.2061512575
    magit-insert-recent-commits                       1           0.783410273   0.783410273
    magit-insert-log                                  2           0.63769903    0.318849515
    magit-rev-verify                                  4           0.601661585   0.1504153962
    magit-git-exit-code                               3           0.6005712080  0.2001904026
    magit-rev-parse                                   3           0.4716020800  0.1572006933
    magit-log-wash-log                                1           0.46797409    0.46797409
    magit-insert-tags-header                          1           0.389292032   0.389292032
    magit-git-items                                   2           0.386998803   0.1934994015
    magit-insert-staged-changes                       1           0.359801993   0.359801993
    magit-abbrev-length                               1           0.31824761    0.31824761
    magit-toplevel                                    21          0.317811276   0.0151338702
    magit-insert-unpulled-from-upstream               1           0.314986998   0.314986998
    magit-insert-head-branch-header                   1           0.302152539   0.302152539
    magit-git-success                                 2           0.294809955   0.1474049775
    magit-rev-format                                  2           0.293499864   0.146749932
    magit-insert-upstream-branch-header               1           0.29064293    0.29064293
    magit-insert-untracked-files                      1           0.242863067   0.242863067
    magit-display-buffer                              1           0.212477492   0.212477492
    magit-bare-repo-p                                 1           0.201640107   0.201640107
    magit-rev-parse-true                              1           0.201567176   0.201567176
    magit-git-true                                    1           0.201562606   0.201562606
    magit-git-output                                  1           0.201557613   0.201557613
    magit-get-current-tag                             2           0.196021831   0.0980109155
    magit-get-next-tag                                1           0.193064518   0.193064518
    magit-insert-unstaged-changes                     1           0.187144843   0.187144843
    magit-git-dir                                     11          0.1754272640  0.0159479330
    magit-insert-merge-log                            1           0.174901715   0.174901715
    magit-merge-in-progress-p                         1           0.174897354   0.174897354
    magit-insert-stashes                              1           0.159585508   0.159585508
    magit-wash-sequence                               3           0.1505684099  0.0501894699
    magit-log-wash-rev                                10          0.149665603   0.0149665603
    magit-get-current-branch                          8           0.1476631309  0.0184578913
    magit-format-ref-labels                           10          0.147321033   0.0147321032
    magit-status-mode                                 1           0.146352289   0.146352289
    magit-rev-ancestor-p                              1           0.146086039   0.146086039
    magit-get-all                                     18          0.145360679   0.0080755932
    magit-config-get-from-cached-list                 19          0.145263918   0.0076454693
    magit-load-config-extensions                      1           0.144793241   0.144793241
    magit-display-buffer-traditional                  1           0.107423347   0.107423347
    magit-section-ident                               147         0.0021125400  1.437...e-05
    magit-mode                                        1           0.000829181   0.000829181
    magit-diff-wash-diffs                             1           0.000642034   0.000642034
    magit-get                                         17          0.0006312269  3.713...e-05
    magit--safe-default-directory                     9           0.0006285869  6.984...e-05
    magit-section                                     19          0.0006018359  3.167...e-05
    magit-diff-wash-diff                              1           0.000599268   0.000599268
    magit-section-cached-visibility                   22          0.000589903   2.681...e-05
    magit-insert-heading                              7           0.00055112    7.873...e-05
    magit-diff-insert-file-section                    1           0.000520999   0.000520999
    magit-maybe-make-margin-overlay                   9           0.00050706    5.634...e-05
    magit-file-accessible-directory-p                 9           0.000468549   5.2061e-05
    magit-section-match                               10          0.0004680669  4.680...e-05
    magit-maybe-save-repository-buffers               1           0.000440343   0.000440343
    magit-save-repository-buffers                     1           0.000433461   0.000433461
    magit-get-push-branch                             5           0.000421858   8.43716e-05
    magit-get-section                                 22          0.000419913   1.908...e-05
    magit-process-environment                         26          0.0003858840  1.484...e-05
    magit-section-match-1                             51          0.0003856660  7.562...e-06
    magit-get-push-remote                             5           0.0003759310  7.518...e-05
    magit-rebase-in-progress-p                        2           0.000323864   0.000161932
    magit-section-show                                7           0.000277453   3.963...e-05
    magit-diff-wash-hunk                              1           0.00026903    0.00026903
    magit-insert-rebase-sequence                      1           0.000250239   0.000250239
    magit-insert-sequencer-sequence                   1           0.00024326    0.00024326
    magit-log-format-margin                           10          0.0002284770  2.284...e-05
    magit-mode-get-buffer                             1           0.000188089   0.000188089
    magit-get-upstream-branch                         2           0.000178769   8.93845e-05
    magit-bisect-in-progress-p                        3           0.0001767080  5.890...e-05
    magit--process-coding-system                      26          0.0001568349  6.032...e-06
    magit-insert-child-count                          20          0.000139597   6.979...e-06
    magit-diff-expansion-threshold                    22          0.000138593   6.299...e-06
    magit-insert-bisect-output                        1           0.000132705   0.000132705
    magit-process-git-arguments                       26          0.000132603   5.100...e-06
    magit-cherry-pick-in-progress-p                   1           0.000122953   0.000122953
    magit-insert-am-sequence                          1           0.000115193   0.000115193
    magit-revert-in-progress-p                        1           0.000114903   0.000114903
    magit-am-in-progress-p                            1           0.000111797   0.000111797
    magit-insert-unpushed-to-pushremote               1           0.00010976    0.00010976
    magit-section-update-highlight                    1           0.000108693   0.000108693
    magit-section-match-assoc                         5           0.000100528   2.01056e-05
    magit-expand-git-file-name                        11          9.6376e-05    8.761...e-06
    magit-insert-push-branch-header                   1           9.618e-05     9.618e-05
    magit-make-margin-overlay                         16          9.1406e-05    5.712875e-06
    magit-delete-line                                 15          8.555...e-05  5.703...e-06
    magit-preserve-section-visibility-cache           19          7.8316e-05    4.121...e-06
    magit-insert-unpulled-from-pushremote             1           7.3261e-05    7.3261e-05
    magit-file-section-p                              22          7.145...e-05  3.248...e-06
    magit-file-section                                2           6.5891e-05    3.29455e-05
    magit--age                                        10          6.1487e-05    6.1487e-06
    magit--assert-default-directory                   1           6.0568e-05    6.0568e-05
    magit-section-match-2                             45          4.7839e-05    1.063...e-06
    magit-log-propertize-keywords                     12          4.7763e-05    3.980...e-06
    magit-diff-highlight                              1           4.1871e-05    4.1871e-05
    magit-section-goto-successor                      1           3.9938e-05    3.9938e-05
    magit-set-buffer-margin                           1           3.2258e-05    3.2258e-05
    magit-insert-bisect-rest                          1           2.7742e-05    2.7742e-05
    magit-hunk-section                                1           2.7432e-05    2.7432e-05
    magit-section-hide                                2           2.6654e-05    1.3327e-05
    magit-insert-bisect-log                           1           2.4944e-05    2.4944e-05
    magit-refresh-get-relative-position               1           2.3263e-05    2.3263e-05
    magit-section-maybe-cache-visibility              9           2.139...e-05  2.377...e-06
    magit-get-boolean                                 1           1.782e-05     1.782e-05
    magit-margin-option                               11          1.307...e-05  1.188...e-06
    magit-process-unset-mode-line-error-status        1           1.2741e-05    1.2741e-05
    magit-ignore-submodules-p                         2           1.253e-05     6.265e-06
    magit-diff-scope                                  1           1.0888e-05    1.0888e-05
    magit-insert-diff-filter-header                   1           1.0598e-05    1.0598e-05
    magit-repository-local-get                        1           9.41e-06      9.41e-06
    magit-section-highlight                           1           9.284e-06     9.284e-06
    magit-current-section                             5           8.803...e-06  1.760...e-06
    magit-set-window-margin                           1           7.655e-06     7.655e-06
    magit-save-window-configuration                   1           7.348e-06     7.348e-06
    magit-diff-type                                   1           6.795e-06     6.795e-06
    magit-maybe-set-dedicated                         1           6.511e-06     6.511e-06
    magit-repository-local-exists-p                   1           5.645e-06     5.645e-06
    magit-auto-revert-mode-enable-in-buffers          1           5.231e-06     5.231e-06
    magit-log-margin-width                            1           5.01e-06      5.01e-06
    magit--tramp-asserts                              1           4.475e-06     4.475e-06
    magit-hunk-section-p                              1           4.097e-06     4.097e-06
    magit-section-make-overlay                        1           2.431e-06     2.431e-06
    magit-region-sections                             1           2.136e-06     2.136e-06
    magit-auto-revert-mode-cmhh                       1           2.103e-06     2.103e-06
    magit-decode-git-path                             2           2.044...e-06  1.022...e-06
    magit-repository-local-repository                 1           1.555e-06     1.555e-06
    magit-xref-setup                                  1           1.51e-06      1.51e-06
    magit-insert-error-header                         1           1.505e-06     1.505e-06
    magit-turn-on-auto-revert-mode-if-desired         1           1.046e-06     1.046e-06
    magit-file-mode-turn-on                           1           9.83e-07      9.83e-07
    magit-buffer-margin-p                             1           9.05e-07      9.05e-07
    magit-cancel-section                              2           0.0           0.0

MACOS의 결과 처리 (매우 빠름) :

   magit-status                                      1           0.584569      0.584569
    magit-process-file                                26          0.5628430000  0.0216478076
    magit-status-internal                             1           0.510929      0.510929
    magit-mode-setup                                  1           0.510912      0.510912
    magit-mode-setup-internal                         1           0.510904      0.510904
    magit-refresh-buffer                              1           0.485749      0.485749
    magit-status-refresh-buffer                       1           0.484318      0.484318
    magit-run-section-hook                            1           0.430791      0.430791
    magit-git-insert                                  13          0.2643129999  0.0203317692
    magit-git-str                                     24          0.2187900000  0.0091162500
    magit-insert-status-headers                       1           0.160217      0.160217
    magit-rev-parse-safe                              20          0.15506       0.007753
    magit-insert-headers                              1           0.139779      0.139779
    magit-insert-head-branch-header                   1           0.139406      0.139406
    magit-git-string                                  12          0.134189      0.0111824166
    magit-insert-unpushed-to-upstream-or-recent       1           0.109471      0.109471
    magit-insert-recent-commits                       1           0.082984      0.082984
    magit-git-exit-code                               3           0.082196      0.0273986666
    magit-insert-remaining-headers                    1           0.07875       0.07875
    magit-toplevel                                    17          0.0727460000  0.0042791764
    magit-rev-verify                                  4           0.0676649999  0.0169162499
    magit-insert-log                                  2           0.066954      0.033477
    magit-git-wash                                    4           0.06692       0.01673
    magit-git-items                                   2           0.064539      0.0322695
    magit-rev-format                                  2           0.056975      0.0284875
    magit-log-wash-log                                1           0.04906       0.04906
    magit-insert-tags-header                          1           0.048515      0.048515
    magit-rev-parse                                   3           0.045511      0.0151703333
    magit-insert-untracked-files                      1           0.043747      0.043747
    magit-abbrev-length                               1           0.032661      0.032661
    magit-insert-unpulled-from-upstream               1           0.032577      0.032577
    magit-insert-staged-changes                       1           0.031339      0.031339
    magit-insert-upstream-branch-header               1           0.03007       0.03007
    magit-git-success                                 2           0.0290969999  0.0145484999
    magit-get-current-tag                             2           0.028617      0.0143085
    magit-status-mode                                 1           0.022703      0.022703
    magit-get-all                                     14          0.0214800000  0.0015342857
    magit-config-get-from-cached-list                 15          0.0213949999  0.0014263333
    magit-load-config-extensions                      1           0.021059      0.021059
    magit-get-next-tag                                1           0.019779      0.019779
    magit-insert-unstaged-changes                     1           0.019263      0.019263
    magit-get-current-branch                          6           0.017693      0.0029488333
    magit-git-dir                                     11          0.017037      0.0015488181
    magit-insert-merge-log                            1           0.016681      0.016681
    magit-wash-sequence                               1           0.016351      0.016351
    magit-insert-stashes                              1           0.016344      0.016344
    magit-log-wash-rev                                11          0.016312      0.0014829090
    magit-bare-repo-p                                 1           0.016012      0.016012
    magit-rev-parse-p                                 1           0.015726      0.015726
    magit-git-true                                    1           0.01572       0.01572
    magit-format-ref-labels                           11          0.014966      0.0013605454
    magit-rev-ancestor-p                              1           0.013539      0.013539
    magit-maybe-save-repository-buffers               1           0.001332      0.001332
    magit-save-repository-buffers                     1           0.001325      0.001325
    magit-mode                                        1           0.001204      0.001204
    magit--safe-default-directory                     9           0.001082      0.0001202222
    magit-file-accessible-directory-p                 9           0.0009219999  0.0001024444
    magit-display-buffer                              1           0.000802      0.000802
    magit-rebase-in-progress-p                        2           0.00054       0.00027
    magit-get                                         13          0.0004720000  3.630...e-05
    magit-insert-heading                              5           0.000455      9.1e-05
    magit-display-buffer-traditional                  1           0.0004        0.0004
    magit-format-ref-label                            14          0.0003319999  2.371...e-05
    magit-insert-rebase-sequence                      1           0.000295      0.000295
    magit-section-show                                16          0.000288      1.8e-05
    magit-get-push-branch                             3           0.000285      9.499...e-05
    magit-insert-sequencer-sequence                   1           0.000253      0.000253
    magit-log-format-margin                           11          0.000248      2.254...e-05
    magit-maybe-make-margin-overlay                   6           0.000239      3.983...e-05
    magit-get-push-remote                             3           0.000234      7.8e-05
    magit-mode-get-buffer                             1           0.000201      0.000201
    magit-section-match-1                             32          0.000183      5.71875e-06
    magit-file-lines                                  1           0.000176      0.000176
    magit-section-match                               7           0.000175      2.5e-05
    magit-bisect-in-progress-p                        3           0.000173      5.766...e-05
    magit-get-upstream-branch                         2           0.000171      8.55e-05
    magit-section-ident                               65          0.0001589999  2.446...e-06
    magit-cherry-pick-in-progress-p                   1           0.000135      0.000135
    magit-section-set-visibility-from-cache           19          0.0001229999  6.473...e-06
    magit-process-git-arguments                       26          0.0001229999  4.730...e-06
    magit-insert-bisect-output                        1           0.000119      0.000119
    magit-insert-unpulled-from-pushremote             1           0.000117      0.000117
    magit-insert-am-sequence                          1           0.000117      0.000117
    magit-revert-in-progress-p                        1           0.000113      0.000113
    magit-am-in-progress-p                            1           0.000113      0.000113
    magit-insert-unpushed-to-pushremote               1           0.000106      0.000106
    magit--process-coding-system                      26          9.300...e-05  3.576...e-06
    magit-insert-push-branch-header                   1           9.2e-05       9.2e-05
    magit-make-margin-overlay                         17          8.9e-05       5.235...e-06
    magit-delete-line                                 11          8.300...e-05  7.545...e-06
    magit-section-update-highlight                    1           7.5e-05       7.5e-05
    magit-section-visibility-ident                    35          6.999...e-05  1.999...e-06
    magit-get-section                                 20          6.8e-05       3.4e-06
    magit-expand-git-file-name                        11          5.900...e-05  5.363...e-06
    magit-diff-highlight                              1           5.1e-05       5.1e-05
    magit--age                                        11          5e-05         4.545...e-06
    magit-cygwin-env-vars                             26          4.699...e-05  1.807...e-06
    magit-section-update-visibility-cache             16          4.499...e-05  2.812...e-06
    magit-diff-expansion-threshold                    19          3.799...e-05  2e-06
    magit-set-buffer-margin                           1           3.6e-05       3.6e-05
    magit-insert-bisect-log                           1           3.1e-05       3.1e-05
    magit-insert-bisect-rest                          1           3e-05         3e-05
    magit-margin-option                               12          1.9e-05       1.583...e-06
    magit-diff-scope                                  1           1.7e-05       1.7e-05
    magit-log-propertize-keywords                     11          1.600...e-05  1.454...e-06
    magit-auto-revert-mode-enable-in-buffers          1           1.5e-05       1.5e-05
    magit-save-window-configuration                   1           1.5e-05       1.5e-05
    magit-get-boolean                                 1           1.5e-05       1.5e-05
    magit-current-section                             5           1.400...e-05  2.800...e-06
    magit-section-match-2                             29          1.4e-05       4.827...e-07
    magit-section-goto-successor                      1           1.4e-05       1.4e-05
    magit-insert-child-count                          16          1.100...e-05  6.875...e-07
    magit-section-highlight                           1           1.1e-05       1.1e-05
    magit-set-window-margin                           1           9e-06         9e-06
    magit-refresh-get-relative-position               1           8e-06         8e-06
    magit-auto-revert-mode-cmhh                       1           5e-06         5e-06
    magit-log-margin-width                            1           4e-06         4e-06
    magit-insert-error-header                         1           2e-06         2e-06
    magit-maybe-set-dedicated                         1           2e-06         2e-06
    magit-buffer-margin-p                             1           2e-06         2e-06
    magit-section-make-overlay                        1           2e-06         2e-06
    magit-diff-type                                   1           2e-06         2e-06
    magit--tramp-asserts                              1           2e-06         2e-06
    magit-region-sections                             1           1e-06         1e-06
    magit-turn-on-auto-revert-mode-if-desired         1           1e-06         1e-06
    magit-diff-use-hunk-region-p                      1           1e-06         1e-06
    magit-insert-diff-filter-header                   1           1e-06         1e-06
    magit-xref-setup                                  1           1e-06         1e-06
    magit-cancel-section                              3           0.0           0.0

  • 답변 # 1

    문제의 반대는 일반적인 문제였습니다. Magit은 macOS에서는 느리지 만 적절한 Unix에서는 빠릅니다. 이 문제는 Emacs 버그와 Emacs 26.1로 업데이트하여 수정되었습니다.

    두 "상황"에는 많은 차이가 있습니다. 이러한 차이점 중 어떤 것이 차이점을 만드는지 알아내는 유일한 방법은 차이점을 하나씩 제거하는 것입니다.

    빠른 상황에서 사용되는 Magit을 업데이트하지 않으면 속도가 느려질 수 있음을 이해합니다. 그러나 성능 회귀가 있고 다른 잠재적 인 문제를 배제 할 수 있다는 것을 알기 때문에 좋은 일입니다.

    ~/.emacs.d/elpa/ 의 사본을 만들 수 있습니다  (또는 관련 패키지 만) 모든 패키지를 다시 설치하십시오. 그렇게하면 성능이 저하되어 알려진 올바른 버전으로 돌아갈 수 있습니다.

    <시간>

    먼 거리에서 모을 수있는 한 문제는 가상 머신입니다. 그것은 느리게하지않았다. 다른 사용자들은 가상 머신에서 Magit을 실행하는 것이 예를 들어 Windows에서 기본적으로 실행하는 것보다빠르다라고보고했습니다. 따라서 사용중인 파일 시스템과 같이 사용중인 가상 머신에 특정한 것일 수 있습니다. 그래도 난 당신보다 그것에 대해 덜 알고 있기 때문에 나는 그것을 도울 수 없습니다.

  • 이전 woocommerce - 주문 상태가 변경되면 API를 호출
  • 다음 React에서 부트 스트랩 navbar에 활성을 추가하려면 어떻게해야합니까?