New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

projectile is very slow when working with tramp #234

Closed
shevchuk opened this Issue Dec 24, 2013 · 26 comments

Comments

Projects
None yet
6 participants
@shevchuk

shevchuk commented Dec 24, 2013

When I do projectile-find-file I can see several messages:

Tramp: Inserting /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'... Tramp: Encoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile...done Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region... Wrote /var/folders/mk/l2wm04594f1_106sn9lj4kd80000gp/T/tramp.436SVy Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region...done Tramp: Inserting/ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'...done
Tramp: Inserting /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'... Tramp: Encoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile...done Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region... Wrote /var/folders/mk/l2wm04594f1_106sn9lj4kd80000gp/T/tramp.436EfB Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region...done Tramp: Inserting/ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'...done
Tramp: Inserting /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'... Tramp: Encoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile...done Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region... Wrote /var/folders/mk/l2wm04594f1_106sn9lj4kd80000gp/T/tramp.436RpH Tramp: Decoding remote file /ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile with function base64-decode-region...done Tramp: Inserting/ssh:192.168.13.205:/home/mico/src/fdl/localStorage/.projectile'...done

Don't know if this is slow because there are some repeatings but tramp itself is ok, e.g. rgrep works fast.

@bbatsov

This comment has been minimized.

Show comment
Hide comment
@bbatsov

bbatsov Jan 8, 2014

Owner

Unfortunately I don't use tramp, so I cannot help you with any insight regarding the problem. It's likely that I used something in Projectile that doesn't play well with tramp, but I have no idea what it is.

Owner

bbatsov commented Jan 8, 2014

Unfortunately I don't use tramp, so I cannot help you with any insight regarding the problem. It's likely that I used something in Projectile that doesn't play well with tramp, but I have no idea what it is.

@thomasf

This comment has been minimized.

Show comment
Hide comment
@thomasf

thomasf Mar 16, 2014

Contributor

There should be an option for this.. I have solved it for myself like this:

(defadvice projectile-on (around exlude-tramp activate)
    (unless  (--any? (and it (file-remote-p it))
        (list
            (buffer-file-name)
            list-buffers-directory
            default-directory))
    ad-do-it))
Contributor

thomasf commented Mar 16, 2014

There should be an option for this.. I have solved it for myself like this:

(defadvice projectile-on (around exlude-tramp activate)
    (unless  (--any? (and it (file-remote-p it))
        (list
            (buffer-file-name)
            list-buffers-directory
            default-directory))
    ad-do-it))
@thomasf

This comment has been minimized.

Show comment
Hide comment
@thomasf

thomasf Mar 16, 2014

Contributor

Anything that uses locate-dominating-file frequently over tramp causes this huge slowdown.

Contributor

thomasf commented Mar 16, 2014

Anything that uses locate-dominating-file frequently over tramp causes this huge slowdown.

@thomasf

This comment has been minimized.

Show comment
Hide comment
@thomasf

thomasf Mar 16, 2014

Contributor

It might or might not make sense to not even check tramp paths at all when this option is set.. There is more user freedom if the option only applies to projectile-on but having it at a lower lever means that we dont also have to manage it in other packages like here: Malabarba/smart-mode-line#70

Contributor

thomasf commented Mar 16, 2014

It might or might not make sense to not even check tramp paths at all when this option is set.. There is more user freedom if the option only applies to projectile-on but having it at a lower lever means that we dont also have to manage it in other packages like here: Malabarba/smart-mode-line#70

@bbatsov bbatsov referenced this issue Mar 16, 2014

Closed

Tramp support #286

@thomasf

This comment has been minimized.

Show comment
Hide comment
@thomasf

thomasf Mar 18, 2014

Contributor

this improves the performance alot for me by disabling cache invalidation for the most common remote lookups thomasf@45791da

The only thing I have tested is having projectile-mode enabled at all while browsing directories with dired and opening some files and it did go from being unusable to tolerable.

Contributor

thomasf commented Mar 18, 2014

this improves the performance alot for me by disabling cache invalidation for the most common remote lookups thomasf@45791da

The only thing I have tested is having projectile-mode enabled at all while browsing directories with dired and opening some files and it did go from being unusable to tolerable.

@bbatsov

This comment has been minimized.

Show comment
Hide comment
@bbatsov

bbatsov Mar 18, 2014

Owner

Looks promising. I guess some tramp users should test your patch and share their experience with it.

Owner

bbatsov commented Mar 18, 2014

Looks promising. I guess some tramp users should test your patch and share their experience with it.

@thomasf

This comment has been minimized.

Show comment
Hide comment
@thomasf

thomasf Mar 18, 2014

Contributor

thomasf@cbe38ff is almost feature complete, it needs to be able to cache some other calls but in essence this it.

Before I make it proper (cleaner code, docstrings, better naming, cache usage control) I would like a code review or comments about the overall structure.

The speedup is noticable on local projects with lots of files as well, even when the cache is turned off due to fewer directory traversals.

Contributor

thomasf commented Mar 18, 2014

thomasf@cbe38ff is almost feature complete, it needs to be able to cache some other calls but in essence this it.

Before I make it proper (cleaner code, docstrings, better naming, cache usage control) I would like a code review or comments about the overall structure.

The speedup is noticable on local projects with lots of files as well, even when the cache is turned off due to fewer directory traversals.

@thomasf

This comment has been minimized.

Show comment
Hide comment
@thomasf

thomasf Mar 19, 2014

Contributor

I have noticed that my patch changes the behaviour of project root finding since all entries in projectile-project-root-files are checked at the same time a ".projectile" file in a parent directory will not override a "composer.json" file in the current directory.
I do not know if this currently is considered a feature or an side effect of the current implementation.

Contributor

thomasf commented Mar 19, 2014

I have noticed that my patch changes the behaviour of project root finding since all entries in projectile-project-root-files are checked at the same time a ".projectile" file in a parent directory will not override a "composer.json" file in the current directory.
I do not know if this currently is considered a feature or an side effect of the current implementation.

@thomasf

This comment has been minimized.

Show comment
Hide comment
@thomasf

thomasf Mar 19, 2014

Contributor

some numbers:

Essentially, the deeper down in the directory tree calling is made from the better the improvements are.
What is instrumented is all of "projectile-" plus "locate-dominating-file"

Unpatched projectile, calling projectile-current-project-files from emacs-24/nt/inc/arpa/ from a local disk

Calling it multiple times gives about the same performance numbers.

projectile-current-project-files                     1           0.483072483   0.483072483
projectile-dir-files                                 1           0.470030463   0.470030463
projectile-dir-files-external                        1           0.323396287   0.323396287
projectile-get-repo-files                            1           0.245264432   0.245264432
projectile-files-via-ext-command                     1           0.242232154   0.242232154
projectile-project-root                              21          0.148315356   0.0070626360
projectile-remove-ignored                            1           0.140196451   0.140196451
projectile-ignored-directories-rel                   1           0.096672302   0.096672302
projectile-ignored-directories                       1           0.08876123    0.08876123
projectile-expand-root                               11          0.0811536059  0.0073776005
locate-dominating-file                               357         0.0623381429  0.0001746166
projectile-project-ignored                           2           0.029837214   0.014918607
projectile-ignored-files-rel                         1           0.029815653   0.029815653
projectile-ignored-files                             1           0.022312607   0.022312607
projectile-parse-dirconfig-file                      3           0.021557865   0.007185955
projectile-dirconfig-file                            3           0.021509908   0.0071699693
projectile-project-ignored-directories               1           0.015063119   0.015063119
projectile-paths-to-ignore                           2           0.01491537    0.007457685
projectile-project-ignored-files                     1           0.014781778   0.014781778
projectile-get-project-directories                   1           0.013033225   0.013033225
projectile-file-truename                             21          0.0031780679  0.0001513365
projectile-get-ext-command                           1           0.003015627   0.003015627
projectile-project-vcs                               1           0.003012415   0.003012415

Patched projectile, calling projectile-current-project-files from emacs-24/nt/inc/arpa/ from a local disk with cache disabled

Calling it multiple times gives about the same performance numbers.

projectile-current-project-files                         1           0.417149618   0.417149618
projectile-dir-files                                     1           0.40755773    0.40755773
projectile-dir-files-external                            1           0.337306764   0.337306764
projectile-get-repo-files                                1           0.259852874   0.259852874
projectile-files-via-ext-command                         1           0.259460059   0.259460059
projectile-remove-ignored                                1           0.0673414     0.0673414
projectile-project-root                                  21          0.044261177   0.0021076750
projectile-locate-dominating-file                        21          0.035154582   0.0016740277
locate-dominating-file                                   21          0.0350633290  0.0016696823
projectile-locate-dominating-file-project-root-p         81          0.034160741   0.0004217375
projectile-ignored-directories-rel                       1           0.024454735   0.024454735
projectile-ignored-directories                           1           0.022314649   0.022314649
projectile-expand-root                                   11          0.0206205599  0.0018745963
projectile-get-project-directories                       1           0.00957221    0.00957221
projectile-file-truename                                 42          0.0088313729  0.0002102707
projectile-parse-dirconfig-file                          3           0.00859736    0.0028657866
projectile-dirconfig-file                                3           0.008525596   0.0028418653
projectile-ignored-files-rel                             1           0.007633992   0.007633992
projectile-project-ignored                               2           0.0072972179  0.0036486089
projectile-ignored-files                                 1           0.005675442   0.005675442
projectile-project-ignored-files                         1           0.003726518   0.003726518
projectile-paths-to-ignore                               2           0.003586187   0.0017930935
projectile-project-ignored-directories                   1           0.003579046   0.003579046
projectile-get-ext-command                               1           0.000377239   0.000377239
projectile-project-vcs                                   1           0.000372405   0.000372405

Patched projectile, calling projectile-current-project-files from emacs-24/nt/inc/arpa/ from a local disk with cache enabled

first run:

projectile-current-project-files                         1           0.378189998   0.378189998
projectile-dir-files                                     1           0.375816326   0.375816326
projectile-dir-files-external                            1           0.332871496   0.332871496
projectile-get-repo-files                                1           0.256436321   0.256436321
projectile-files-via-ext-command                         1           0.256130443   0.256130443
projectile-remove-ignored                                1           0.042541628   0.042541628
projectile-project-root                                  21          0.009585737   0.0004564636
projectile-file-truename                                 42          0.00710979    0.0001692807
projectile-ignored-directories-rel                       1           0.005479978   0.005479978
projectile-ignored-directories                           1           0.004844328   0.004844328
projectile-expand-root                                   11          0.004366246   0.0003969314
projectile-parse-dirconfig-file                          3           0.002796296   0.0009320986
projectile-dirconfig-file                                3           0.00274886    0.0009162866
projectile-get-project-directories                       1           0.002363407   0.002363407
projectile-locate-dominating-file                        21          0.0022529210  0.0001072819
locate-dominating-file                                   21          0.0021786839  0.0001037468
projectile-ignored-files-rel                             1           0.001675244   0.001675244
projectile-project-ignored                               2           0.0016308210  0.0008154105
projectile-locate-dominating-file-project-root-cached-p  81          0.0015968179  1.971...e-05
projectile-locate-dominating-file-project-root-p         4           0.001482469   0.0003706172
projectile-ignored-files                                 1           0.001223435   0.001223435
projectile-paths-to-ignore                               2           0.0008383240  0.0004191620
projectile-project-ignored-files                         1           0.000821163   0.000821163
projectile-project-ignored-directories                   1           0.000818869   0.000818869
projectile-get-ext-command                               1           0.000293739   0.000293739
projectile-project-vcs                                   1           0.000289377   0.000289377

Second run:

projectile-current-project-files                         1           0.368969866   0.368969866
projectile-dir-files                                     1           0.367463121   0.367463121
projectile-dir-files-external                            1           0.322990626   0.322990626
projectile-get-repo-files                                1           0.242469917   0.242469917
projectile-files-via-ext-command                         1           0.241974141   0.241974141
projectile-remove-ignored                                1           0.043875706   0.043875706
projectile-project-root                                  21          0.009115317   0.0004340627
projectile-file-truename                                 42          0.007958822   0.0001894957
projectile-ignored-directories-rel                       1           0.005430948   0.005430948
projectile-ignored-directories                           1           0.004812983   0.004812983
projectile-expand-root                                   11          0.004350219   0.0003954744
projectile-parse-dirconfig-file                          3           0.001890087   0.0006300289
projectile-dirconfig-file                                3           0.001841632   0.0006138773
projectile-ignored-files-rel                             1           0.001778975   0.001778975
projectile-project-ignored                               2           0.001720783   0.0008603915
projectile-get-project-directories                       1           0.001490667   0.001490667
projectile-ignored-files                                 1           0.001327689   0.001327689
projectile-project-ignored-files                         1           0.000930899   0.000930899
projectile-locate-dominating-file                        21          0.0008995810  4.283...e-05
projectile-paths-to-ignore                               2           0.000871581   0.0004357905
locate-dominating-file                                   21          0.000814729   3.879...e-05
projectile-project-ignored-directories                   1           0.000798262   0.000798262
projectile-get-ext-command                               1           0.00047675    0.00047675
projectile-project-vcs                                   1           0.000469377   0.000469377
projectile-locate-dominating-file-project-root-cached-p  81          0.0001089419  1.344...e-06

Unpatched projectile, calling projectile-current-project-files from project-root/site/static/vendor/js/pickadate/translations/ from a tramp scp connection

(seems to go on forever so I ran the patched tests while this was working)

projectile-current-project-files                     1           330.06107349  330.06107349
projectile-project-root                              21          329.07085068  15.670040508
locate-dominating-file                               357         324.35433945  0.9085555727
projectile-dir-files                                 1           297.40699261  297.40699261
projectile-remove-ignored                            1           275.62281440  275.62281440
projectile-ignored-directories-rel                   1           210.53901875  210.53901875
projectile-ignored-directories                       1           194.35065381  194.35065381
projectile-expand-root                               11          178.23165488  16.202877717
projectile-ignored-files-rel                         1           65.082411625  65.082411625
projectile-project-ignored                           2           65.047136107  32.523568053
projectile-parse-dirconfig-file                      3           49.248298476  16.416099492
projectile-dirconfig-file                            3           49.013880294  16.337960098
projectile-ignored-files                             1           48.930909064  48.930909064
projectile-paths-to-ignore                           2           32.886422007  16.443211003
projectile-project-ignored-files                     1           32.854658381  32.854658381
projectile-get-project-directories                   1           32.654065793  32.654065793
projectile-project-ignored-directories               1           32.192493432  32.192493432
projectile-dir-files-external                        1           5.774229077   5.774229077
projectile-get-repo-files                            1           5.356910939   5.356910939
projectile-get-ext-command                           1           5.047947874   5.047947874
projectile-project-vcs                               1           5.04794274    5.04794274
projectile-file-truename                             21          1.656558934   0.0788837587
projectile-files-via-ext-command                     1           0.308953013   0.308953013
projectile-current-project-files                     1           330.06107349  330.06107349
projectile-project-root                              21          329.07085068  15.670040508
locate-dominating-file                               357         324.35433945  0.9085555727
projectile-dir-files                                 1           297.40699261  297.40699261
projectile-remove-ignored                            1           275.62281440  275.62281440
projectile-ignored-directories-rel                   1           210.53901875  210.53901875
projectile-ignored-directories                       1           194.35065381  194.35065381
projectile-expand-root                               11          178.23165488  16.202877717
projectile-ignored-files-rel                         1           65.082411625  65.082411625
projectile-project-ignored                           2           65.047136107  32.523568053
projectile-parse-dirconfig-file                      3           49.248298476  16.416099492
projectile-dirconfig-file                            3           49.013880294  16.337960098
projectile-ignored-files                             1           48.930909064  48.930909064
projectile-paths-to-ignore                           2           32.886422007  16.443211003
projectile-project-ignored-files                     1           32.854658381  32.854658381
projectile-get-project-directories                   1           32.654065793  32.654065793
projectile-project-ignored-directories               1           32.192493432  32.192493432
projectile-dir-files-external                        1           5.774229077   5.774229077
projectile-get-repo-files                            1           5.356910939   5.356910939
projectile-get-ext-command                           1           5.047947874   5.047947874
projectile-project-vcs                               1           5.04794274    5.04794274
projectile-file-truename                             21          1.656558934   0.0788837587
projectile-files-via-ext-command                     1           0.308953013   0.308953013

Patched projectile, calling projectile-current-project-files from project-root/site/static/vendor/js/pickadate/translations/ from a tramp scp connection, cache disabled

projectile-current-project-files                         1           19.243941696  19.243941696
projectile-project-root                                  21          18.502907358  0.8810908266
projectile-locate-dominating-file                        21          17.986550553  0.8565024072
locate-dominating-file                                   21          17.986430787  0.8564967041
projectile-locate-dominating-file-project-root-p         141         17.952264214  0.1273210227
projectile-dir-files                                     1           10.481386756  10.481386756
projectile-remove-ignored                                1           9.705864886   9.705864886
projectile-ignored-files-rel                             1           9.006521881   9.006521881
projectile-parse-dirconfig-file                          3           8.8154555690  2.9384851896
projectile-dirconfig-file                                3           8.8142486359  2.9380828786
projectile-get-project-directories                       1           8.76254325    8.76254325
projectile-dir-files-external                            1           0.722122722   0.722122722
projectile-ignored-directories-rel                       1           0.695943413   0.695943413
projectile-ignored-directories                           1           0.633108617   0.633108617
projectile-expand-root                                   11          0.583773429   0.0530703117
projectile-file-truename                                 42          0.516031766   0.0122864706
projectile-project-ignored                               2           0.306218226   0.153109113
projectile-ignored-files                                 1           0.257942906   0.257942906
projectile-get-repo-files                                1           0.238779019   0.238779019
projectile-files-via-ext-command                         1           0.236575318   0.236575318
projectile-project-ignored-files                         1           0.201022636   0.201022636
projectile-paths-to-ignore                               2           0.196675562   0.098337781
projectile-project-ignored-directories                   1           0.105206695   0.105206695
projectile-get-ext-command                               1           0.00219516    0.00219516
projectile-project-vcs                                   1           0.002190523   0.002190523

Patched projectile, calling projectile-current-project-files from project-root/site/static/vendor/js/pickadate/translations/ from a tramp scp connection, cache enabled

first run:

projectile-current-project-files                         1           10.323244043  10.323244043
projectile-project-root                                  21          9.5750701989  0.4559557237
projectile-get-project-directories                       1           9.354635848   9.354635848
projectile-parse-dirconfig-file                          3           9.3422923589  3.1140974529
projectile-dirconfig-file                                3           9.2643679780  3.0881226593
projectile-locate-dominating-file                        21          9.111111595   0.4338624569
locate-dominating-file                                   21          9.110976669   0.4338560318
projectile-locate-dominating-file-project-root-cached-p  141         9.0734978590  0.0643510486
projectile-locate-dominating-file-project-root-p         7           9.073079873   1.2961542675
projectile-dir-files                                     1           0.968591085   0.968591085
projectile-dir-files-external                            1           0.651268188   0.651268188
projectile-file-truename                                 42          0.4635937810  0.0110379471
projectile-remove-ignored                                1           0.314668946   0.314668946
projectile-ignored-files-rel                             1           0.271984481   0.271984481
projectile-get-repo-files                                1           0.243632839   0.243632839
projectile-files-via-ext-command                         1           0.242408886   0.242408886
projectile-ignored-files                                 1           0.090112151   0.090112151
projectile-project-ignored                               2           0.089765683   0.0448828415
projectile-paths-to-ignore                               2           0.085792597   0.0428962985
projectile-project-ignored-files                         1           0.085380558   0.085380558
projectile-ignored-directories-rel                       1           0.039335438   0.039335438
projectile-ignored-directories                           1           0.027681439   0.027681439
projectile-expand-root                                   11          0.02701519    0.0024559263
projectile-project-ignored-directories                   1           0.004394562   0.004394562
projectile-get-ext-command                               1           0.001214139   0.001214139
projectile-project-vcs                                   1           0.001209507   0.001209507

second run:

projectile-current-project-files                         1           1.054677895   1.054677895
projectile-dir-files                                     1           1.049758586   1.049758586
projectile-dir-files-external                            1           0.727696493   0.727696493
projectile-remove-ignored                                1           0.320087625   0.320087625
projectile-get-repo-files                                1           0.308230055   0.308230055
projectile-ignored-files-rel                             1           0.275434538   0.275434538
projectile-files-via-ext-command                         1           0.229520903   0.229520903
projectile-project-root                                  21          0.226888523   0.0108042153
projectile-file-truename                                 42          0.1919249910  0.0045696426
projectile-ignored-files                                 1           0.098551837   0.098551837
projectile-project-ignored                               2           0.097918411   0.0489592055
projectile-project-ignored-files                         1           0.093091821   0.093091821
projectile-parse-dirconfig-file                          3           0.092940066   0.030980022
projectile-paths-to-ignore                               2           0.0900586350  0.0450293175
projectile-get-ext-command                               1           0.078697077   0.078697077
projectile-project-vcs                                   1           0.078686525   0.078686525
projectile-ignored-directories-rel                       1           0.041132469   0.041132469
projectile-locate-dominating-file                        21          0.0346413580  0.0016495884
locate-dominating-file                                   21          0.03452095    0.0016438547
projectile-ignored-directories                           1           0.029108801   0.029108801
projectile-expand-root                                   11          0.0286675090  0.0026061371
projectile-dirconfig-file                                3           0.011417659   0.0038058863
projectile-get-project-directories                       1           0.004906255   0.004906255
projectile-project-ignored-directories                   1           0.004841831   0.004841831
projectile-locate-dominating-file-project-root-cached-p  141         0.0002726420  1.933...e-06
Contributor

thomasf commented Mar 19, 2014

some numbers:

Essentially, the deeper down in the directory tree calling is made from the better the improvements are.
What is instrumented is all of "projectile-" plus "locate-dominating-file"

Unpatched projectile, calling projectile-current-project-files from emacs-24/nt/inc/arpa/ from a local disk

Calling it multiple times gives about the same performance numbers.

projectile-current-project-files                     1           0.483072483   0.483072483
projectile-dir-files                                 1           0.470030463   0.470030463
projectile-dir-files-external                        1           0.323396287   0.323396287
projectile-get-repo-files                            1           0.245264432   0.245264432
projectile-files-via-ext-command                     1           0.242232154   0.242232154
projectile-project-root                              21          0.148315356   0.0070626360
projectile-remove-ignored                            1           0.140196451   0.140196451
projectile-ignored-directories-rel                   1           0.096672302   0.096672302
projectile-ignored-directories                       1           0.08876123    0.08876123
projectile-expand-root                               11          0.0811536059  0.0073776005
locate-dominating-file                               357         0.0623381429  0.0001746166
projectile-project-ignored                           2           0.029837214   0.014918607
projectile-ignored-files-rel                         1           0.029815653   0.029815653
projectile-ignored-files                             1           0.022312607   0.022312607
projectile-parse-dirconfig-file                      3           0.021557865   0.007185955
projectile-dirconfig-file                            3           0.021509908   0.0071699693
projectile-project-ignored-directories               1           0.015063119   0.015063119
projectile-paths-to-ignore                           2           0.01491537    0.007457685
projectile-project-ignored-files                     1           0.014781778   0.014781778
projectile-get-project-directories                   1           0.013033225   0.013033225
projectile-file-truename                             21          0.0031780679  0.0001513365
projectile-get-ext-command                           1           0.003015627   0.003015627
projectile-project-vcs                               1           0.003012415   0.003012415

Patched projectile, calling projectile-current-project-files from emacs-24/nt/inc/arpa/ from a local disk with cache disabled

Calling it multiple times gives about the same performance numbers.

projectile-current-project-files                         1           0.417149618   0.417149618
projectile-dir-files                                     1           0.40755773    0.40755773
projectile-dir-files-external                            1           0.337306764   0.337306764
projectile-get-repo-files                                1           0.259852874   0.259852874
projectile-files-via-ext-command                         1           0.259460059   0.259460059
projectile-remove-ignored                                1           0.0673414     0.0673414
projectile-project-root                                  21          0.044261177   0.0021076750
projectile-locate-dominating-file                        21          0.035154582   0.0016740277
locate-dominating-file                                   21          0.0350633290  0.0016696823
projectile-locate-dominating-file-project-root-p         81          0.034160741   0.0004217375
projectile-ignored-directories-rel                       1           0.024454735   0.024454735
projectile-ignored-directories                           1           0.022314649   0.022314649
projectile-expand-root                                   11          0.0206205599  0.0018745963
projectile-get-project-directories                       1           0.00957221    0.00957221
projectile-file-truename                                 42          0.0088313729  0.0002102707
projectile-parse-dirconfig-file                          3           0.00859736    0.0028657866
projectile-dirconfig-file                                3           0.008525596   0.0028418653
projectile-ignored-files-rel                             1           0.007633992   0.007633992
projectile-project-ignored                               2           0.0072972179  0.0036486089
projectile-ignored-files                                 1           0.005675442   0.005675442
projectile-project-ignored-files                         1           0.003726518   0.003726518
projectile-paths-to-ignore                               2           0.003586187   0.0017930935
projectile-project-ignored-directories                   1           0.003579046   0.003579046
projectile-get-ext-command                               1           0.000377239   0.000377239
projectile-project-vcs                                   1           0.000372405   0.000372405

Patched projectile, calling projectile-current-project-files from emacs-24/nt/inc/arpa/ from a local disk with cache enabled

first run:

projectile-current-project-files                         1           0.378189998   0.378189998
projectile-dir-files                                     1           0.375816326   0.375816326
projectile-dir-files-external                            1           0.332871496   0.332871496
projectile-get-repo-files                                1           0.256436321   0.256436321
projectile-files-via-ext-command                         1           0.256130443   0.256130443
projectile-remove-ignored                                1           0.042541628   0.042541628
projectile-project-root                                  21          0.009585737   0.0004564636
projectile-file-truename                                 42          0.00710979    0.0001692807
projectile-ignored-directories-rel                       1           0.005479978   0.005479978
projectile-ignored-directories                           1           0.004844328   0.004844328
projectile-expand-root                                   11          0.004366246   0.0003969314
projectile-parse-dirconfig-file                          3           0.002796296   0.0009320986
projectile-dirconfig-file                                3           0.00274886    0.0009162866
projectile-get-project-directories                       1           0.002363407   0.002363407
projectile-locate-dominating-file                        21          0.0022529210  0.0001072819
locate-dominating-file                                   21          0.0021786839  0.0001037468
projectile-ignored-files-rel                             1           0.001675244   0.001675244
projectile-project-ignored                               2           0.0016308210  0.0008154105
projectile-locate-dominating-file-project-root-cached-p  81          0.0015968179  1.971...e-05
projectile-locate-dominating-file-project-root-p         4           0.001482469   0.0003706172
projectile-ignored-files                                 1           0.001223435   0.001223435
projectile-paths-to-ignore                               2           0.0008383240  0.0004191620
projectile-project-ignored-files                         1           0.000821163   0.000821163
projectile-project-ignored-directories                   1           0.000818869   0.000818869
projectile-get-ext-command                               1           0.000293739   0.000293739
projectile-project-vcs                                   1           0.000289377   0.000289377

Second run:

projectile-current-project-files                         1           0.368969866   0.368969866
projectile-dir-files                                     1           0.367463121   0.367463121
projectile-dir-files-external                            1           0.322990626   0.322990626
projectile-get-repo-files                                1           0.242469917   0.242469917
projectile-files-via-ext-command                         1           0.241974141   0.241974141
projectile-remove-ignored                                1           0.043875706   0.043875706
projectile-project-root                                  21          0.009115317   0.0004340627
projectile-file-truename                                 42          0.007958822   0.0001894957
projectile-ignored-directories-rel                       1           0.005430948   0.005430948
projectile-ignored-directories                           1           0.004812983   0.004812983
projectile-expand-root                                   11          0.004350219   0.0003954744
projectile-parse-dirconfig-file                          3           0.001890087   0.0006300289
projectile-dirconfig-file                                3           0.001841632   0.0006138773
projectile-ignored-files-rel                             1           0.001778975   0.001778975
projectile-project-ignored                               2           0.001720783   0.0008603915
projectile-get-project-directories                       1           0.001490667   0.001490667
projectile-ignored-files                                 1           0.001327689   0.001327689
projectile-project-ignored-files                         1           0.000930899   0.000930899
projectile-locate-dominating-file                        21          0.0008995810  4.283...e-05
projectile-paths-to-ignore                               2           0.000871581   0.0004357905
locate-dominating-file                                   21          0.000814729   3.879...e-05
projectile-project-ignored-directories                   1           0.000798262   0.000798262
projectile-get-ext-command                               1           0.00047675    0.00047675
projectile-project-vcs                                   1           0.000469377   0.000469377
projectile-locate-dominating-file-project-root-cached-p  81          0.0001089419  1.344...e-06

Unpatched projectile, calling projectile-current-project-files from project-root/site/static/vendor/js/pickadate/translations/ from a tramp scp connection

(seems to go on forever so I ran the patched tests while this was working)

projectile-current-project-files                     1           330.06107349  330.06107349
projectile-project-root                              21          329.07085068  15.670040508
locate-dominating-file                               357         324.35433945  0.9085555727
projectile-dir-files                                 1           297.40699261  297.40699261
projectile-remove-ignored                            1           275.62281440  275.62281440
projectile-ignored-directories-rel                   1           210.53901875  210.53901875
projectile-ignored-directories                       1           194.35065381  194.35065381
projectile-expand-root                               11          178.23165488  16.202877717
projectile-ignored-files-rel                         1           65.082411625  65.082411625
projectile-project-ignored                           2           65.047136107  32.523568053
projectile-parse-dirconfig-file                      3           49.248298476  16.416099492
projectile-dirconfig-file                            3           49.013880294  16.337960098
projectile-ignored-files                             1           48.930909064  48.930909064
projectile-paths-to-ignore                           2           32.886422007  16.443211003
projectile-project-ignored-files                     1           32.854658381  32.854658381
projectile-get-project-directories                   1           32.654065793  32.654065793
projectile-project-ignored-directories               1           32.192493432  32.192493432
projectile-dir-files-external                        1           5.774229077   5.774229077
projectile-get-repo-files                            1           5.356910939   5.356910939
projectile-get-ext-command                           1           5.047947874   5.047947874
projectile-project-vcs                               1           5.04794274    5.04794274
projectile-file-truename                             21          1.656558934   0.0788837587
projectile-files-via-ext-command                     1           0.308953013   0.308953013
projectile-current-project-files                     1           330.06107349  330.06107349
projectile-project-root                              21          329.07085068  15.670040508
locate-dominating-file                               357         324.35433945  0.9085555727
projectile-dir-files                                 1           297.40699261  297.40699261
projectile-remove-ignored                            1           275.62281440  275.62281440
projectile-ignored-directories-rel                   1           210.53901875  210.53901875
projectile-ignored-directories                       1           194.35065381  194.35065381
projectile-expand-root                               11          178.23165488  16.202877717
projectile-ignored-files-rel                         1           65.082411625  65.082411625
projectile-project-ignored                           2           65.047136107  32.523568053
projectile-parse-dirconfig-file                      3           49.248298476  16.416099492
projectile-dirconfig-file                            3           49.013880294  16.337960098
projectile-ignored-files                             1           48.930909064  48.930909064
projectile-paths-to-ignore                           2           32.886422007  16.443211003
projectile-project-ignored-files                     1           32.854658381  32.854658381
projectile-get-project-directories                   1           32.654065793  32.654065793
projectile-project-ignored-directories               1           32.192493432  32.192493432
projectile-dir-files-external                        1           5.774229077   5.774229077
projectile-get-repo-files                            1           5.356910939   5.356910939
projectile-get-ext-command                           1           5.047947874   5.047947874
projectile-project-vcs                               1           5.04794274    5.04794274
projectile-file-truename                             21          1.656558934   0.0788837587
projectile-files-via-ext-command                     1           0.308953013   0.308953013

Patched projectile, calling projectile-current-project-files from project-root/site/static/vendor/js/pickadate/translations/ from a tramp scp connection, cache disabled

projectile-current-project-files                         1           19.243941696  19.243941696
projectile-project-root                                  21          18.502907358  0.8810908266
projectile-locate-dominating-file                        21          17.986550553  0.8565024072
locate-dominating-file                                   21          17.986430787  0.8564967041
projectile-locate-dominating-file-project-root-p         141         17.952264214  0.1273210227
projectile-dir-files                                     1           10.481386756  10.481386756
projectile-remove-ignored                                1           9.705864886   9.705864886
projectile-ignored-files-rel                             1           9.006521881   9.006521881
projectile-parse-dirconfig-file                          3           8.8154555690  2.9384851896
projectile-dirconfig-file                                3           8.8142486359  2.9380828786
projectile-get-project-directories                       1           8.76254325    8.76254325
projectile-dir-files-external                            1           0.722122722   0.722122722
projectile-ignored-directories-rel                       1           0.695943413   0.695943413
projectile-ignored-directories                           1           0.633108617   0.633108617
projectile-expand-root                                   11          0.583773429   0.0530703117
projectile-file-truename                                 42          0.516031766   0.0122864706
projectile-project-ignored                               2           0.306218226   0.153109113
projectile-ignored-files                                 1           0.257942906   0.257942906
projectile-get-repo-files                                1           0.238779019   0.238779019
projectile-files-via-ext-command                         1           0.236575318   0.236575318
projectile-project-ignored-files                         1           0.201022636   0.201022636
projectile-paths-to-ignore                               2           0.196675562   0.098337781
projectile-project-ignored-directories                   1           0.105206695   0.105206695
projectile-get-ext-command                               1           0.00219516    0.00219516
projectile-project-vcs                                   1           0.002190523   0.002190523

Patched projectile, calling projectile-current-project-files from project-root/site/static/vendor/js/pickadate/translations/ from a tramp scp connection, cache enabled

first run:

projectile-current-project-files                         1           10.323244043  10.323244043
projectile-project-root                                  21          9.5750701989  0.4559557237
projectile-get-project-directories                       1           9.354635848   9.354635848
projectile-parse-dirconfig-file                          3           9.3422923589  3.1140974529
projectile-dirconfig-file                                3           9.2643679780  3.0881226593
projectile-locate-dominating-file                        21          9.111111595   0.4338624569
locate-dominating-file                                   21          9.110976669   0.4338560318
projectile-locate-dominating-file-project-root-cached-p  141         9.0734978590  0.0643510486
projectile-locate-dominating-file-project-root-p         7           9.073079873   1.2961542675
projectile-dir-files                                     1           0.968591085   0.968591085
projectile-dir-files-external                            1           0.651268188   0.651268188
projectile-file-truename                                 42          0.4635937810  0.0110379471
projectile-remove-ignored                                1           0.314668946   0.314668946
projectile-ignored-files-rel                             1           0.271984481   0.271984481
projectile-get-repo-files                                1           0.243632839   0.243632839
projectile-files-via-ext-command                         1           0.242408886   0.242408886
projectile-ignored-files                                 1           0.090112151   0.090112151
projectile-project-ignored                               2           0.089765683   0.0448828415
projectile-paths-to-ignore                               2           0.085792597   0.0428962985
projectile-project-ignored-files                         1           0.085380558   0.085380558
projectile-ignored-directories-rel                       1           0.039335438   0.039335438
projectile-ignored-directories                           1           0.027681439   0.027681439
projectile-expand-root                                   11          0.02701519    0.0024559263
projectile-project-ignored-directories                   1           0.004394562   0.004394562
projectile-get-ext-command                               1           0.001214139   0.001214139
projectile-project-vcs                                   1           0.001209507   0.001209507

second run:

projectile-current-project-files                         1           1.054677895   1.054677895
projectile-dir-files                                     1           1.049758586   1.049758586
projectile-dir-files-external                            1           0.727696493   0.727696493
projectile-remove-ignored                                1           0.320087625   0.320087625
projectile-get-repo-files                                1           0.308230055   0.308230055
projectile-ignored-files-rel                             1           0.275434538   0.275434538
projectile-files-via-ext-command                         1           0.229520903   0.229520903
projectile-project-root                                  21          0.226888523   0.0108042153
projectile-file-truename                                 42          0.1919249910  0.0045696426
projectile-ignored-files                                 1           0.098551837   0.098551837
projectile-project-ignored                               2           0.097918411   0.0489592055
projectile-project-ignored-files                         1           0.093091821   0.093091821
projectile-parse-dirconfig-file                          3           0.092940066   0.030980022
projectile-paths-to-ignore                               2           0.0900586350  0.0450293175
projectile-get-ext-command                               1           0.078697077   0.078697077
projectile-project-vcs                                   1           0.078686525   0.078686525
projectile-ignored-directories-rel                       1           0.041132469   0.041132469
projectile-locate-dominating-file                        21          0.0346413580  0.0016495884
locate-dominating-file                                   21          0.03452095    0.0016438547
projectile-ignored-directories                           1           0.029108801   0.029108801
projectile-expand-root                                   11          0.0286675090  0.0026061371
projectile-dirconfig-file                                3           0.011417659   0.0038058863
projectile-get-project-directories                       1           0.004906255   0.004906255
projectile-project-ignored-directories                   1           0.004841831   0.004841831
projectile-locate-dominating-file-project-root-cached-p  141         0.0002726420  1.933...e-06
@bbatsov

This comment has been minimized.

Show comment
Hide comment
@bbatsov

bbatsov Mar 19, 2014

Owner

The performance numbers look pretty good. I'll do a review of the code later today.

As for the .projectile - the ability to override the default project root resolution is something I consider a feature, as somethings the project you're in might be actually comprised of several repos that would normally be considered projects on their own.

Owner

bbatsov commented Mar 19, 2014

The performance numbers look pretty good. I'll do a review of the code later today.

As for the .projectile - the ability to override the default project root resolution is something I consider a feature, as somethings the project you're in might be actually comprised of several repos that would normally be considered projects on their own.

@thomasf

This comment has been minimized.

Show comment
Hide comment
@thomasf

thomasf Mar 20, 2014

Contributor

would it be ok if .projectile is the only file in project-root-files that allow
parent overriding? This would still greatly lessen the number of file-exists-p
checks that is done all the time. When all queries gets cached the result would
of course be quick but the initial traversal on slower file systems like tramp
would still be very slow.

Contributor

thomasf commented Mar 20, 2014

would it be ok if .projectile is the only file in project-root-files that allow
parent overriding? This would still greatly lessen the number of file-exists-p
checks that is done all the time. When all queries gets cached the result would
of course be quick but the initial traversal on slower file systems like tramp
would still be very slow.

@bbatsov

This comment has been minimized.

Show comment
Hide comment
@bbatsov

bbatsov Mar 20, 2014

Owner

Yeah, I think that would be OK.

Owner

bbatsov commented Mar 20, 2014

Yeah, I think that would be OK.

@kovan

This comment has been minimized.

Show comment
Hide comment
@kovan

kovan Mar 23, 2014

@thomasf I have been testing your patch these last days, and it works pretty good :). With an empty cache, projectile-find-file takes around 3 seconds in a remote project with 5500 files (ssh compression enabled, 60ms ping). After that everything works flawlessly and instantly.

kovan commented Mar 23, 2014

@thomasf I have been testing your patch these last days, and it works pretty good :). With an empty cache, projectile-find-file takes around 3 seconds in a remote project with 5500 files (ssh compression enabled, 60ms ping). After that everything works flawlessly and instantly.

@shevchuk

This comment has been minimized.

Show comment
Hide comment
@shevchuk

shevchuk Mar 24, 2014

nice, waiting for this to be merged

shevchuk commented Mar 24, 2014

nice, waiting for this to be merged

@Silex

This comment has been minimized.

Show comment
Hide comment
@Silex

Silex Mar 24, 2014

Contributor

Will there be an easy way to reset the cache?

Contributor

Silex commented Mar 24, 2014

Will there be an easy way to reset the cache?

@thomasf

This comment has been minimized.

Show comment
Hide comment
@thomasf

thomasf Mar 24, 2014

Contributor

yes, I will change how the cache works a bit. Should this cache be controlled by the current cache invalidation commands? I also think the default should be to cache only remote files.

Contributor

thomasf commented Mar 24, 2014

yes, I will change how the cache works a bit. Should this cache be controlled by the current cache invalidation commands? I also think the default should be to cache only remote files.

@thomasf

This comment has been minimized.

Show comment
Hide comment
@thomasf

thomasf Mar 27, 2014

Contributor

@bbatsov I have a small problem, locate-dominating-file just started
supporting predicates as it second argument like last year.

My first merge request will not contain the cache code but supporting code that
makes the cache stuff possible to implement. Also I might have considered to focus the cache of file-exists-p since that is the lowest level function that seems to be involved in stealing time.

Supposedly the addition of a new defcustom would be the user facing change.

(defcustom projectile-project-root-parents-files
  '(".projectile"        ; projectile project marker)
  "A list of files considered to mark the root of a project that
overriding matches for `projectile-project-root-files' in parent
directories."
  :group 'projectile
  :type '(repeat string))

(defcustom projectile-project-root-files
  '(".git"               ; Git VCS root dir
    ".hg"                ; Mercurial VCS root dir
    ".fslckout"          ; Fossil VCS root dir
    ".bzr"               ; Bazaar VCS root dir
    "_darcs"             ; Darcs VCS root dir
    "rebar.config"       ; Rebar project file
    "project.clj"        ; Leiningen project file
    "pom.xml"            ; Maven project file
    "build.sbt"          ; SBT project file
    "build.gradle"       ; Gradle project file
    "Gemfile"            ; Bundler file
    "requirements.txt"   ; Pip file
    "package.json"       ; npm package file
    "Gruntfile.js"       ; Grunt project file
    "bower.json"         ; Bower project file
    "composer.json"      ; Composer project file
    )
  "A list of files considered to mark the root of a project."
  :group 'projectile
  :type '(repeat string))

Or possibly baking it into the current defcustom like this:

(defcustom projectile-project-root-files
  '((".projectile" . 'parents)  ; projectile project marker)
    ".git"               ; Git VCS root dir
    ".hg"                ; Mercurial VCS root dir
    ".fslckout"          ; Fossil VCS root dir
    ".bzr"               ; Bazaar VCS root dir
    "_darcs"             ; Darcs VCS root dir
    "rebar.config"       ; Rebar project file
    "project.clj"        ; Leiningen project file
    "pom.xml"            ; Maven project file
    "build.sbt"          ; SBT project file
    "build.gradle"       ; Gradle project file
    "Gemfile"            ; Bundler file
    "requirements.txt"   ; Pip file
    "package.json"       ; npm package file
    "Gruntfile.js"       ; Grunt project file
    "bower.json"         ; Bower project file
    "composer.json"      ; Composer project file
    )
  "A list of files considered to mark the root of a project."
  :group 'projectile
  :type '(repeat string))

Anyhow, for of this to work locate-dominating-file has to be quite recent,
the paths to make it work that I see are:

  1. Copy locate-dominating-file from files.el and possibly adapt it to
    projectile circumstances.
  2. Detect which version of locate-dominating-file that is available and disable
    non parent finding for older emacses.

I think that option 1 is the best combined with using the emacs provided locate-dominating-stop-dir-regexp that at least seems to exist in my emacs23.

Do you have any thoughts on any of this?

Contributor

thomasf commented Mar 27, 2014

@bbatsov I have a small problem, locate-dominating-file just started
supporting predicates as it second argument like last year.

My first merge request will not contain the cache code but supporting code that
makes the cache stuff possible to implement. Also I might have considered to focus the cache of file-exists-p since that is the lowest level function that seems to be involved in stealing time.

Supposedly the addition of a new defcustom would be the user facing change.

(defcustom projectile-project-root-parents-files
  '(".projectile"        ; projectile project marker)
  "A list of files considered to mark the root of a project that
overriding matches for `projectile-project-root-files' in parent
directories."
  :group 'projectile
  :type '(repeat string))

(defcustom projectile-project-root-files
  '(".git"               ; Git VCS root dir
    ".hg"                ; Mercurial VCS root dir
    ".fslckout"          ; Fossil VCS root dir
    ".bzr"               ; Bazaar VCS root dir
    "_darcs"             ; Darcs VCS root dir
    "rebar.config"       ; Rebar project file
    "project.clj"        ; Leiningen project file
    "pom.xml"            ; Maven project file
    "build.sbt"          ; SBT project file
    "build.gradle"       ; Gradle project file
    "Gemfile"            ; Bundler file
    "requirements.txt"   ; Pip file
    "package.json"       ; npm package file
    "Gruntfile.js"       ; Grunt project file
    "bower.json"         ; Bower project file
    "composer.json"      ; Composer project file
    )
  "A list of files considered to mark the root of a project."
  :group 'projectile
  :type '(repeat string))

Or possibly baking it into the current defcustom like this:

(defcustom projectile-project-root-files
  '((".projectile" . 'parents)  ; projectile project marker)
    ".git"               ; Git VCS root dir
    ".hg"                ; Mercurial VCS root dir
    ".fslckout"          ; Fossil VCS root dir
    ".bzr"               ; Bazaar VCS root dir
    "_darcs"             ; Darcs VCS root dir
    "rebar.config"       ; Rebar project file
    "project.clj"        ; Leiningen project file
    "pom.xml"            ; Maven project file
    "build.sbt"          ; SBT project file
    "build.gradle"       ; Gradle project file
    "Gemfile"            ; Bundler file
    "requirements.txt"   ; Pip file
    "package.json"       ; npm package file
    "Gruntfile.js"       ; Grunt project file
    "bower.json"         ; Bower project file
    "composer.json"      ; Composer project file
    )
  "A list of files considered to mark the root of a project."
  :group 'projectile
  :type '(repeat string))

Anyhow, for of this to work locate-dominating-file has to be quite recent,
the paths to make it work that I see are:

  1. Copy locate-dominating-file from files.el and possibly adapt it to
    projectile circumstances.
  2. Detect which version of locate-dominating-file that is available and disable
    non parent finding for older emacses.

I think that option 1 is the best combined with using the emacs provided locate-dominating-stop-dir-regexp that at least seems to exist in my emacs23.

Do you have any thoughts on any of this?

@bbatsov

This comment has been minimized.

Show comment
Hide comment
@bbatsov

bbatsov Apr 11, 2014

Owner

Fixed by #299.

Owner

bbatsov commented Apr 11, 2014

Fixed by #299.

@bbatsov bbatsov closed this Apr 11, 2014

@thomasf

This comment has been minimized.

Show comment
Hide comment
@thomasf

thomasf Apr 11, 2014

Contributor

not really fixed yet but it is a lot snappier.

Contributor

thomasf commented Apr 11, 2014

not really fixed yet but it is a lot snappier.

@jaseemabid

This comment has been minimized.

Show comment
Hide comment
@jaseemabid

jaseemabid Sep 23, 2014

Contributor

Can I test this on a topic branch or something? I use tramp all day and its a pretty bad experience.

Contributor

jaseemabid commented Sep 23, 2014

Can I test this on a topic branch or something? I use tramp all day and its a pretty bad experience.

@shevchuk

This comment has been minimized.

Show comment
Hide comment
@shevchuk

shevchuk Sep 23, 2014

Jaseem, that would be nice, also I'm having problems when working with
projectile projects from different machines (and having different hostnames
for the host machine on them since it is coded in /etc/hosts)

2014-09-23 18:27 GMT+04:00 Jaseem Abid notifications@github.com:

Can I test this on a topic branch or something? I use tramp all day and
its a pretty bad experience.


Reply to this email directly or view it on GitHub
#234 (comment).

shevchuk commented Sep 23, 2014

Jaseem, that would be nice, also I'm having problems when working with
projectile projects from different machines (and having different hostnames
for the host machine on them since it is coded in /etc/hosts)

2014-09-23 18:27 GMT+04:00 Jaseem Abid notifications@github.com:

Can I test this on a topic branch or something? I use tramp all day and
its a pretty bad experience.


Reply to this email directly or view it on GitHub
#234 (comment).

@Silex

This comment has been minimized.

Show comment
Hide comment
@Silex

Silex Sep 23, 2014

Contributor

I did some investiguation the other day and a simple fix is to disable projectile-global-mode when you are over TRAMP and not fiddling with files inside a project.

The slowness mainly comes from all the hooks calling projectile-project-root, which tries to guess which project you are in. When you are not in a project, it has to naviguate up to / which takes time over TRAMP.

I have ideas about how to fix it but it requires some thinking. A simple idea would be to disable all the project detection until absolutely necessary, e.g if you call C-c p f then we know that now you want to detect a project.

The main slowness is simply the modeline and the find-file hooks for the project cache & friends.

I was somewhat working on a pull request (https://github.com/Silex/projectile) but I got distracted. We'll see if I can come up with something in the next days.

Contributor

Silex commented Sep 23, 2014

I did some investiguation the other day and a simple fix is to disable projectile-global-mode when you are over TRAMP and not fiddling with files inside a project.

The slowness mainly comes from all the hooks calling projectile-project-root, which tries to guess which project you are in. When you are not in a project, it has to naviguate up to / which takes time over TRAMP.

I have ideas about how to fix it but it requires some thinking. A simple idea would be to disable all the project detection until absolutely necessary, e.g if you call C-c p f then we know that now you want to detect a project.

The main slowness is simply the modeline and the find-file hooks for the project cache & friends.

I was somewhat working on a pull request (https://github.com/Silex/projectile) but I got distracted. We'll see if I can come up with something in the next days.

@jaseemabid

This comment has been minimized.

Show comment
Hide comment
@jaseemabid

jaseemabid Sep 25, 2014

Contributor

Maybe a tramp specific projectile minor mode?
I guess a lot of projectile users are on mac, and also a lot of them also use a linux VM for dev?

Contributor

jaseemabid commented Sep 25, 2014

Maybe a tramp specific projectile minor mode?
I guess a lot of projectile users are on mac, and also a lot of them also use a linux VM for dev?

@bbatsov

This comment has been minimized.

Show comment
Hide comment
@bbatsov

bbatsov Sep 25, 2014

Owner

Then I guess they should start using nfs instead of tramp. This is a much better solution imo. —
Sent from Mailbox

On Thu, Sep 25, 2014 at 11:01 AM, Jaseem Abid notifications@github.com
wrote:

Maybe a tramp specific projectile minor mode?

I guess a lot of projectile users are on mac, and also a lot of them also use a linux VM for dev?

Reply to this email directly or view it on GitHub:
#234 (comment)

Owner

bbatsov commented Sep 25, 2014

Then I guess they should start using nfs instead of tramp. This is a much better solution imo. —
Sent from Mailbox

On Thu, Sep 25, 2014 at 11:01 AM, Jaseem Abid notifications@github.com
wrote:

Maybe a tramp specific projectile minor mode?

I guess a lot of projectile users are on mac, and also a lot of them also use a linux VM for dev?

Reply to this email directly or view it on GitHub:
#234 (comment)

@Silex

This comment has been minimized.

Show comment
Hide comment
@Silex

Silex Sep 25, 2014

Contributor

I use TRAMP mainly to edit files & run commands over ssh for various servers all over the place at work. I also sometimes edit files over FTP that way.

I don't think NFS can replace this workflow.

Anyway, I'm almost done with my proof of concept implementation. Watch for the PR that'll reference this issue soonish.

Contributor

Silex commented Sep 25, 2014

I use TRAMP mainly to edit files & run commands over ssh for various servers all over the place at work. I also sometimes edit files over FTP that way.

I don't think NFS can replace this workflow.

Anyway, I'm almost done with my proof of concept implementation. Watch for the PR that'll reference this issue soonish.

@jaseemabid

This comment has been minimized.

Show comment
Hide comment
@jaseemabid

jaseemabid Oct 6, 2014

Contributor

@bbatsov I'll give it a try and let you know the results.

Contributor

jaseemabid commented Oct 6, 2014

@bbatsov I'll give it a try and let you know the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment