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

snack building a big project takes 12m. #156

Open
YuMingLiao opened this issue Oct 29, 2019 · 2 comments
Open

snack building a big project takes 12m. #156

YuMingLiao opened this issue Oct 29, 2019 · 2 comments

Comments

@YuMingLiao
Copy link

--Here is a big project.
$ time snack build                                                                           
/nix/store/lw1fskf7gr6fqi4z5y1v39lnxmzf4gvk-build.json                                                                              
                                                                                                                                    
real    12m16.200s
user    12m3.206s
sys     0m1.394s

$ cat package.nix
let
  lib =
    { src = ./src;
      dependencies = [ "aeson" "base" "bytestring" "case-insensitive" "classy-prelude" "classy-prelude-conduit" "classy-prelude-yesod" "conduit" "containers" "data-default" "directory" "fast-logger" "file-embed" "foreign-store" "hjsmin" "http-client-tls" "http-conduit" "monad-control" "monad-logger" "safe" "shakespeare" "template-haskell" "text" "time" "unordered-containers" "vector" "wai" "wai-extra" "wai-logger" "warp" "warp-tls" "yaml" "yesod" "yesod-core" "yesod-form" "yesod-static" "project-m36" "yesod-auth" "rio" "project-m36-typed" "basic-sop" "th-utilities" "yesod-crud" "yesod-auth-fb" "yesod-fb" "fb" "yesod-auth-oauth2" ];                         
      extensions = [ "OverloadedStrings" "TemplateHaskell"];
    };
in
  { main = "main";
    src = ./app;
    packages = [ lib ];
    dependencies = [ "aeson" "base" "bytestring" "case-insensitive" "classy-prelude" "classy-prelude-conduit" "classy-prelude-yesod"
"conduit" "containers" "data-default" "directory" "fast-logger" "file-embed" "foreign-store" "hjsmin" "http-client-tls" "http-conduit" "monad-control" "monad-logger" "safe" "shakespeare" "template-haskell" "text" "time" "unordered-containers" "vector" "wai" "wai-extra" "wai-logger" "warp" "warp-tls" "yaml" "yesod" "yesod-core" "yesod-form" "yesod-static" "project-m36" "yesod-auth" "rio" "project-m36-typed" "basic-sop" ];
    extensions = [ "OverloadedStrings" "TemplateHaskell"];
    extra-directories = (modName: [ ./. ]);
}

--Here is a small project.
$ time snack build
/nix/store/cc05z3rgb87r9ah39dfakkrvahzw3dlb-build.json

real    0m9.668s
user    0m8.463s
sys     0m0.805s

$cat package.nix
let
  lib =
    { src = ./src;
      dependencies = [ "base" "file-embed" "text" "yaml" "yesod" "yesod-core" "yesod-form" "yesod-static" "classy-prelude" "classy-prelude-yesod"]; 
      extensions = [ "OverloadedStrings" "TemplateHaskell"];
#      extra-directories =
#       (modName: [./config]) ;
    };
in
  { main = "main";
    src = ./app;
    packages = [ lib ];
    dependencies = [ "base" "file-embed" "text" "yaml" "yesod" "yesod-core" "yesod-form" "yesod-static" "classy-prelude" "classy-prelude-yesod"]; 
    extra-directories =
       (modName: [./.]) ;
  }

47 packages (several local ones) vs 10 packages.

Is it a normal time?

@nmattia
Copy link
Owner

nmattia commented Oct 29, 2019

It's not "normal" but at the moment it's (unfortunately) kind of expected. There are some performance issues. See these tickets:

I know @zimbatm and @NinjaTrappeur have looked into ways of benchmarking and speeding up evaluation, maybe they have some tips?

@picnoir
Copy link

picnoir commented Oct 29, 2019

I'm not yet ready to answer this. I'll write a proper blog post + documentation when the callgraph profiler will be ready.

That said, (according to git blame) @zimbatm and @grahamc already delivered a timing-based flamegraph profiler. Some instruction about how to use it there: NixOS/nix@ee9c988

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

3 participants