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

git-annex loads very slowly when dynamically linked #4239

Closed
ghost opened this issue Sep 23, 2014 · 4 comments
Closed

git-annex loads very slowly when dynamically linked #4239

ghost opened this issue Sep 23, 2014 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 23, 2014

git-annex has a lot of Haskell dependencies, which makes it really slow to load up when it's dynamically linked.

It takes over 3 seconds to start on my machine, even for just a simple "git-annex version". This constant delay makes git-annex very painful to use in the terminal. Both the official build and a simple static version of the Nix build load nearly instantly.

I put the following override in my config.nix:

cabalStatic = haskellPackages.cabal.override {
  enableStaticLibraries   = true;
  enableSharedLibraries   = false;
  enableSharedExecutables = false;
};

gitAnnexStatic = haskellPackages.gitAnnex.override {
  cabal = cabalStatic;
};

That builds and runs correctly, so git-annex should probably be static by default. I assume this also affects all other Haskell tools, but git-annex is the only big one I use.

(I'm still completely new to Nix (and Haskell), so I have no idea how to further test or profile this. Is there a reason Haskell tools, in particular the ones with giant dependencies, are dynamically linked?)

@peti
Copy link
Member

peti commented Sep 23, 2014

I guess the severity of this issue depends on the speed of your machine / hard disk. On my laptop, git annex version responds within a second, which isn't super fast, but the delay is not very noticeable either. Anyway, it might be worthwhile to link this binary statically just to reduce the number of run-time dependencies.

peti added a commit that referenced this issue Sep 23, 2014
@peti
Copy link
Member

peti commented Sep 23, 2014

Fixed by 6476678.

@peti peti closed this as completed Sep 23, 2014
@ghost
Copy link
Author

ghost commented Feb 6, 2015

Switching git-annex over to haskell-ng lost this fix and reintroduced the problem.

(I don't get haskell's arcane build setup, or else I'd've submitted a hopefully trivial patch.)

peti added a commit to peti/nixpkgs that referenced this issue Feb 6, 2015
git-annex has literally dozens of dependencies, and loading all of them
at run-time can be slow (NixOS#4239).
@peti
Copy link
Member

peti commented Feb 6, 2015

peti@f145201 disables shared liking for git-annex again.

@peti peti mentioned this issue Aug 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant