Skip to content
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

Slow loading when path subdirectory doesn't have git initialized #126

Open
arielcorte opened this issue Oct 10, 2024 · 4 comments
Open

Slow loading when path subdirectory doesn't have git initialized #126

arielcorte opened this issue Oct 10, 2024 · 4 comments

Comments

@arielcorte
Copy link

After I installed the tool and configured the path to my coding directory, loading the sessions took a few seconds.

I started to indagate into the problem, by copying one by one the subdirectories to another path. I found that when I added a subdirectory without an initialized git repo, the time was increased by a few seconds (instead of milliseconds).

I tried configuring --max-depths 1 with no noticeable effect.

The workaround that solved the loading time for me was to make a script to run git init in each subdirectory.

@jrmoulton
Copy link
Owner

I'm not sure what is going on in your specific case. I have subdirectories without initialized git repos and don't have any delay. Do you have any other specific information?

@arielcorte
Copy link
Author

arielcorte commented Oct 14, 2024

I don't know what info might help you here.

I have my coding directory with 107 repos (the one I initialized git in all of them) and works faster than a test directory in which I added 3 non initialized git subdirectories.

➜  ~ tms config -p coding 
Configuration has been stored
➜  ~ time tms
tms  0.02s user 0.08s system 13% cpu 0.695 total
➜  ~ tms config -p tms_test 
Configuration has been stored
➜  ~ time tms
tms  0.03s user 0.21s system 28% cpu 0.830 total
➜  ~ ls tms_test 
no-git2  non-git  not-git
➜  ~ ls tms_test/not-git 
➜  ~ ls tms_test/non-git 
112A_cf.cpp    1630_cses.cpp  1661_cses.cpp  1955B_cf.cpp  2004A_cf.cpp  230A_cf.cpp  2428_cses_copy.cpp  codeforces  cses              template.cpp
1399A_cf.cpp   1643_cses.cpp  1662_cses.cpp  1956A_cf.cpp  2004B_cf.cpp  231A.py      2428_cses.cpp       contest1    glistering_melon  test_template.cpp
1629_cses.cpp  1660_cses.cpp  166A_cf.cpp    1956B_cf.cpp  2004C_cf.cpp  231.cpp      a.out               contest2    printing          tmp.cpp
➜  ~ cd coding/
zsh: do you wish to see all 107 possibilities (22 lines)? 

coding directory with 107 subdirectories:

➜  ~ tms config -p coding 
Configuration has been stored
➜  ~ time tms
tms  0.02s user 0.08s system 15% cpu 0.619 total
➜  ~ time tms
tms  0.02s user 0.08s system 18% cpu 0.531 total
➜  ~ time tms
tms  0.02s user 0.08s system 21% cpu 0.442 total

tms_test directory with 3 non initialized git directories:

➜  ~ tms config -p tms_test 
Configuration has been stored
➜  ~ time tms
tms  0.03s user 0.21s system 30% cpu 0.782 total
➜  ~ time tms
tms  0.03s user 0.21s system 32% cpu 0.742 total
➜  ~ time tms
tms  0.02s user 0.22s system 29% cpu 0.814 total

I think it is important to also note that the subdirectories of tms_test are directly copied from coding but removed the .git repository

@arielcorte
Copy link
Author

I've also noticed that python directories are also causing a bit of a delay with its .venv. Here's the time of tms after deleting it from tms_test/no-git2/deep_learning/.venv:

➜  ~ tms config -p tms_test
Configuration has been stored
➜  ~ time tms
tms  0.03s user 0.15s system 24% cpu 0.712 total
➜  ~ time tms
tms  0.02s user 0.15s system 25% cpu 0.676 total
➜  ~ time tms
tms  0.02s user 0.15s system 27% cpu 0.623 total

which is still greater than the coding directory

@arielcorte
Copy link
Author

After deleting the other python venv directory in tms_test/non-git/.../venv, the times make more sense:

➜  ~ tms config -p tms_test
Configuration has been stored
➜  ~ time tms
tms  0.01s user 0.02s system 2% cpu 0.870 total
➜  ~ time tms
tms  0.01s user 0.01s system 7% cpu 0.328 total
➜  ~ time tms
tms  0.01s user 0.01s system 3% cpu 0.638 total

All the tests were done with --max-depth = 1 so shouldn't tms skip the venv directories?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants