-
Notifications
You must be signed in to change notification settings - Fork 16
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
Better understanding transitive sizes #14
Comments
Hey, thank you for creating the issue! If I understood you correctly, this feature is already implemented (but it's totally undocumented, so I don't expect anyone to figure it out by themselves) :). On
Using your terminology first size there is the "closure size", and the second parenthesised size is "single-owner" size. It's called "added size" in the codebase; as in "how much size does depending on that store path add on top of everything else", or alternatively "how much size do I save if I were to stop depending on that specific derivation". To be honest I think, both "added size" and "single owner size" is a bit arbitrary, but I don't have anything better. But as you can imagine, I have no idea how to make it clearer on the application that it is what it is. Your explanation on this issue is pretty accurate, so I think we should add it to README (probably rendering that dependency tree as a graph so it's easier to see). But I wish there was a way to present that number in the app in a way that is obvious without looking at the documentation. Do you have any idea on how to do this? |
I'm thinking that it would be most obvious to repeat the added size in the status line. There's enough room there to write Could I also ask for the option to sort the entries by added size? |
Thanks for the suggestion. That makes sense, but it was a bit wordy, so I added "Added size" to the status line, and added a "Glossary" to the
This is a similar question to #5. Since it seems like a common request, I implemented this functionality on df01088 (tl;dr: the key s toggles the order, and there are somes visual cues). I'll cut a release tomorrow (after looking at your other issue #15), meanwhile I'm closing this issue, but please do let me know what you think! |
What if you changed it to:
That is: introduce another package G which is essentially a copy of F Do I understand correctly that it would effectively obscure the size of both?
And so on for 3, 4, 5 etc? It feels like "1" is only a special case of a more general problem. Although it does seem like this problem is generally intractable. The problem this tool tries to solve reminds me of performance profiling, and flame graphs. But the top comment on a HN thread about them is poignant and seems to ask a similar question. They do mention pprof which can output a dotfile with weighted nodes--maybe that could be a nice way to solve this for nix-tree? |
Yes! I think your graph summarizes the meaning of the single-owner thing well. I know that it does not feel very consistent. This is another form of issues caused by I'm sure we can tackle/workaround the performance issue with it. Worst case we'll run it in a background thread or something. But my problem is more about its UX. I found it useful in some cases, but you're right that it's not clear at all. This is pretty much the only part people are confused about nix-tree. On the other hand, there are also multiple people who has asked for this exact feature without figuring out it already exists, so it is somehow useful. These days I keep thinking about the "marking" feature described here #15. Maybe we need to be able to:
So, when someone wants to replicate the added size, they can go to the derivation, "mark" all the derivations downstream, and the total size of the "unmarked" closures would be the added size. But they can also mark multiple derivations to answer some more questions. |
Would it be possible to track 3 sizes: the package size and closure size like now, and the "single-owner" closure size?
Right now, if two packages depend on the same thing, the ownership is muddled. So I wonder if it would be more obvious if we could see the closure size of things that are not shared with other closures at the same or closer distance from the root?
Given this tree:
the sizes would be
This would show us that F is the biggest package, and while C has a big closure, removing it will only remove E
The text was updated successfully, but these errors were encountered: