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
Nixpkgs performance regression #3594
Comments
@edolstra I wrote a small script to graph the evolution of the evaluation time, but I discovered it was constant. I tried on another computer (one with a SSD), and I have found a difference between master and 14.04. Can you confirm that you have a SSD and that the evaluation is IO-bound otherwise? Anyway, I'll use my script on my SSD-computer and show you the results. |
Another big regression: With A quick git bisect points at 62bfe75, but there may be other contributors. |
This may be related to the OOMs while evaluating the |
The OOMs may have started here: b2fdcf8 |
Yes, it could be because of nodePackages.
|
I actually tought that this could happen after i automatically detect platforms on which node packages should be built. The fact is these few exported node packages have a lot of dependencies and recursive dependency avoidance algorithm is not so trivial. So if anyone could propose optimization or we don't export those packages. |
I will try to optimizem it for sake of evaluation in following days. |
@offlinehacker can we revert meanwhile? |
Meh, i will comment out platforms, don't revert or it will break node
|
I think |
Reverting b2fdcf8 doesn't solve the problem for me. |
Forget about the above comment, I'm able to Perhaps I should try evaluating the whole release-combined instead of only "tested", not sure I will be able to do it with my ram :( |
I'm also able to evaluate the whole |
@edolstra could you help out with the hydra issue? I have to revert back to |
I can evaluate master with reverting b2fdcf8, without that it gets killed by OOM (8GB of ram). @offlinehacker I'm reverting the commit if you don't find a reasonable argument/solution in a day. We haven't updated unstable channel in 17 days and nixpkgs in 40 days. This is slowing down development of NixOS project quite a bit. |
Ok, i will take time tomorrow(today to be more precise) to fix this, if i
|
Hmmm, I can also evaluate master with 6.5GB of ram. @edolstra is it because hydra uses old kernel? I'm using 3.18. |
I've pushed 1e4ba02. PS: |
How can i test performance issues, i was trying to fix this today, i don't have 8GB of ram to try to evaluate everything. If i do |
Will try with hydra-eval-jobs instead of nix-build. |
@offlinehacker, in all fairness, it's not like someone "just revert some commits". Also, note that @iElectric has posted the exact command-line he's using to re-produce the problem. |
So with a commit of 6 days ago 0bc51ea (because of binary cache) I can reproduce the problem with hydra-eval-jobs. But I don't think it's something related to node packages, honestly. Node packages were evaluated just fine. The fact that's the commit where hydra stopped evaluating, is not a 1:1 indication it's a node packages problem. @iElectric you wasn't very clear, were you able to evaluate the jobset after reverting the commits, while you weren't before? Here it stopped when evaluating tests, right after the i3wm test. The problem is just it needs more ram nowadays, I believe. Nothing related to node packages. E.g. the evaluation hit 7.9gb of ram out of 8gb for a long time, so the GC was a lot aggressive on keeping below the max ram. At some point however it just needed more ram, wasn't there, and stopped. That's it, at least what I observed. |
There we go, first eval after a month: http://hydra.nixos.org/eval/1178620 |
@offlinehacker with 0461f35 you could try applying nodePackages fixes again and see how much it increases memory usage |
@iElectric nice, so with current master i get 4.45s for |
With nodePackages problematic commits (master): Memory usage: 5149MB (105% increase) Without the problematic commits (51d4656): Memory usage: 2508MB PS: tested with
|
@edolstra do you think the regression is bad enough not to have such commits? |
Well the real problem is that i don't have any idea what's going on in hydra-eval-jobs that's causing such memory usage, what can i easily make is disable building node packages on hydra. |
That might be a good solution as build time is very quick for npm/iojs |
Not so quick anymore in comparisson how fast npm is now. |
Ok, is there any better way to disable builds on hydra as removing platforms? |
By removing |
Ah, ok 👍 |
2273MB 👍 |
So I looked into this, and bisecting was fast enough (about 12 steps between master and the merge-base against 14.12): 8fb5494 add kde-applications-14.12.1. On my notebook there's a distinct jump on that single commit – all I've seen before was faster and all after was slower than the point of jump (from the ~11 commits tried in-between).
ATM I don't see what makes it so slow, /cc @ttuegel. Just removing |
@vcunat It's probably because that commit adds ~2.8k lines of Nix code between two files. Are you sure you removed |
Yes, sure (I did check that KDE packages disappeared from the list). A better test case is:
... counting second and further runs, as the first one can create derivations. For me it jumps from ~0.26s to ~3.9s! |
That makes sense. |
Would you look at it? (To avoid duplicating effort; though I'd be unlikely to do it today anyway.) |
Sure, I'll take a look. One remark I can make off-hand is that something is different about the KDE packages because evaluating a package from |
I'd expect some of the many transformations in there is/are expensive, as the kde expressions are built in a rather complex way. |
Sounds great! Thanks a lot :-) |
We're back to 7.5G of memory usage for |
I removed recurseIntoAttrs for node 5.0 and 4.3 packages and it's now down to 4.6G. |
Two reasons for this change: - most of 5.0 packages don't build yet - node packages are memory intensive and block Hydra evaluation (Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS) PS: Removing node packages from evaluation goes from 7.5G down to 4.6G for whole nixos release job. See #3594 and #11865
Doing
nix-env -qa
on master now takes 2.81s on my system, while on the 14.04 branch it was only 1.72s, a 63% increase. Meanwhile the number of packages only increased by 9%.We should do a bisect to figure out what caused the slowdown.
The text was updated successfully, but these errors were encountered: