-
Notifications
You must be signed in to change notification settings - Fork 11
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
Evaluation is too slow #125
Comments
Actually, I realize that I've completely misread the above. Sorry. It is copying the repository to the store which takes so long! |
jsonAction
is built every time
FWIW, this is also what takes the longest on my computer, but just not as long (it might be due to the size of the repo, or to the type of hardware).
|
The explanation was that @Alizter's repository was full of build artifacts. Still, copying the sources to the store should not be needed. Before my PR, this was excluded when in https://github.com/coq/coq/blob/96cf2fd5444b44bfd41b9f2fe50d27496da135a7/default.nix#L99-L100 Would there be a way of achieving the same in the Coq Nix Toolbox? |
Looking further, we noticed that the excluding function that was implemented in the Coq repository does not work: src =
with builtins; filterSource
(path: _:
!elem (baseNameOf path) [".git" "result" "bin" "_build" "_build_ci" "_build_vo" ".nix"]) ../../..; This does not exclude So this seems to be something that we could fix to make things faster for the Coq case. Still, having a way of skipping the copying of the source when getting into |
I tried to fix the source filtering function by using another technique only to discover that my first filtering function was actually fine. It's just that during the evaluation of
even though the source that is used by the The former store path has copied everything included filtered out directories, while the latter has the filters applied correctly. In the current Nix setup in the Coq repository (without the Toolbox), we don't have this issue that the source is copied to the store once without the filters (even when running |
So indeed, the Coq Nix Toolbox needs to import the current directory as a source, and we cannot apply exactly the same filters (in particular, we cannot filter out the
@CohenCyril Can you tell me what this was supposed to do: coq-nix-toolbox/config-parser-1.0.0/normalize.nix Lines 41 to 48 in 84cb9c4
I guess it was precisely some attempt at doing some filtering? And thus, it cannot be composed with a call to |
No this was an attempt to have shallow git clones to avoid time consuming source fetching when faced with potentially git repos.
I prefer to be able to pass the a predicate... but, actually, I'd prefer the source filtering to be done by each derivation (and that hashes of the various sources take the filtering into account), so that for example changing |
Since the Coq Nix Toolbox does need the |
While testing my PR using the Coq Nix Toolbox on the Coq repo (coq/coq#14435), @Alizter noticed that getting into
nix-shell
takes extremely long compared tomaster
(it's close to a minute vs 4 seconds for him, and it is about 12 vs 3 seconds for me).Using
nix-shell --debug --run exit 2>&1 | ts '[%Y-%m-%d %H:%M:%S]' | xclip -selection clipboard
, he was able to obtain a log with timings (https://ctxt.io/2/AAAQEsEJEw), from which we learn that most of the time is spent there:So it looks like instantiating thejsonAction
on every call tonix-shell
(and everynix-build
) is seriously impacting the performance of the Coq Nix Toolbox.Could we find a way of not instantiating it or making it trivially faster?What I'm considering is adding agen-action ? false
parameter todefault.nix
and changing the value of an attribute based on this.@CohenCyril WDYT?
The text was updated successfully, but these errors were encountered: