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

Devenv slows down with big code repositories #257

Closed
shyim opened this issue Dec 27, 2022 · 24 comments
Closed

Devenv slows down with big code repositories #257

shyim opened this issue Dec 27, 2022 · 24 comments
Labels
bug Something isn't working
Milestone

Comments

@shyim
Copy link
Contributor

shyim commented Dec 27, 2022

Describe the bug

When you have a big project and maybe some cache like 10 GB it gets really slowed down by git commands. Maybe that command can be ignored?

 |   \-+= 25589 root /usr/bin/login -fpl shyim /Applications/iTerm.app/Contents/MacOS/ShellLauncher --launch_shell
 |     \-+= 25590 shyim -zsh
 |       \-+- 25994 shyim -zsh
 |         \-+- 25995 shyim /usr/local/bin/direnv export zsh
 |           \-+- 25996 shyim /bin/bash -c eval "$("/usr/local/bin/direnv" stdlib)" && __main__ source_env $'/Users/shyim/Code/shopware/cloud/.envrc'
 |             \-+- 26011 shyim /bin/bash -c eval "$("/usr/local/bin/direnv" stdlib)" && __main__ source_env $'/Users/shyim/Code/shopware/cloud/.envrc'
 |               \-+- 26012 shyim bash /Users/shyim/.nix-profile/bin/devenv print-dev-env
 |                 \-+- 26021 shyim /nix/store/ynwgbyq3p1db8wg5hw8b192l3336g65b-nix-2.12.0pre20221221_51b770e/bin/nix --show-trace --extra-experimental-features nix-command --extra-experimental-features flakes print-dev-env --impure
 |                   \--- 26027 shyim git -C /Users/shyim/Code/shopware/cloud --git-dir .git ls-files --cached -z --others
@shyim shyim added the bug Something isn't working label Dec 27, 2022
@shyim
Copy link
Contributor Author

shyim commented Dec 27, 2022

--others seems like REALLY slow down because it looks then also in the cache folder / node_modules and so

@shyim
Copy link
Contributor Author

shyim commented Dec 27, 2022

Seems like introduced by custom nix domenkozar/nix@bf9922e

@domenkozar
Copy link
Member

We need this to be able to support .devenv.flake.nix, probably a better way is to just to add it to the output.

@shyim
Copy link
Contributor Author

shyim commented Dec 27, 2022

We could also generate a generic flake.nix and commit that? 🤔

@domenkozar
Copy link
Member

@shyim do you have a workaround for this or does it need to be fixed soon?

@shyim
Copy link
Contributor Author

shyim commented Dec 28, 2022

I am thinking about adding a hybrid solution. .envrc uses nix flake directly and maybe the users still use devenv up.
and the flake just imports existing devenv.nix

@domenkozar
Copy link
Member

Flakes verbatim copy the whole repo into the /nix/store so that's also slower in general :)

@shyim
Copy link
Contributor Author

shyim commented Dec 28, 2022

okay then I don't have a solution 😂

@shyim
Copy link
Contributor Author

shyim commented Dec 28, 2022

But your --others is there to find like devenv.nix and so? Can we not explicit check that this files exists?

@domenkozar
Copy link
Member

I'll look into this tomorrow

@domenkozar
Copy link
Member

I know what to fix there, needs a few hours of work. Making it high priority :)

@GaetanLepage
Copy link

Flakes verbatim copy the whole repo into the /nix/store so that's also slower in general :)

Eelco and others are working on getting rid of this constraint: NixOS/nix#6530

@domenkozar
Copy link
Member

devenv already includes this PR, but it's still slow (not minutes as it was before, but now in seconds).

@GaetanLepage
Copy link

devenv already includes this PR, but it's still slow (not minutes as it was before, but now in seconds).

Oh cool ! Do you think it will get merged upstream anytime soon ?
Has it been working fine in devenv until now ?

@domenkozar
Copy link
Member

devenv already includes this PR, but it's still slow (not minutes as it was before, but now in seconds).

Oh cool ! Do you think it will get merged upstream anytime soon ? Has it been working fine in devenv until now ?

I hope it will be merged soon, it has been working more or less fine :)

@domenkozar domenkozar added this to the 0.6 milestone Jan 30, 2023
@domenkozar
Copy link
Member

I believe this is fixed in #745, could you give it a try and report back?

@shyim
Copy link
Contributor Author

shyim commented Aug 21, 2023

I can't test it at Home, somehow the python cannot be built on my machine. It just hangs forever configure. I will try it at work tomorrow, maybe that helps.

@domenkozar
Copy link
Member

I can't test it at Home, somehow the python cannot be built on my machine. It just hangs forever configure. I will try it at work tomorrow, maybe that helps.

Having the full log would be helpful and what OS exactly it hangs on.

@domenkozar
Copy link
Member

I believe this is fixed in 1.0.1, can somebody confirm?

@shyim
Copy link
Contributor Author

shyim commented Mar 22, 2024

for me it takes like 25seconds to devenv up starts the processes. feels long 🤔

@domenkozar
Copy link
Member

Using 1.0.1? How can I reproduce this?

@shyim
Copy link
Contributor Author

shyim commented Mar 22, 2024

yup

devenv 1.0.1 (aarch64-darwin)
git clone https://github.com/shopware/shopware.git
cd shopware
devenv up

@domenkozar domenkozar modified the milestones: 0.6, 1.1 Mar 25, 2024
@shyim
Copy link
Contributor Author

shyim commented Mar 28, 2024

Is there something nice to debug what is slow at devenv up. We have here an M1 Pro with 32GB of memory it takes 3 minutes to start it. It takes like a minute until it shows something and then two times resolving something

Maybe an idea to have an --debug flag, which shows any command executed and the duration in the shell?

@domenkozar
Copy link
Member

This has been fixed in 1.3! More work will follow as part of #1548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants