-
Notifications
You must be signed in to change notification settings - Fork 247
Improve shellFor selectComponents
performance
#1146
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
Conversation
Not sure if I understand correctly, but is there a use case where we might want Do you have an example where this increases performance? |
That's a good point. I didn't include something like this this in the original PR, because I was worried about use cases like that too. Testing this against my work proprietary codebase, I'm getting a decrease from 15s to 10s for starting up a shellFor without any packages specified. Oddly I still seem to get that performance boost, if I remove the part that filters out non-local packages. So, maybe the regression has something to do with the implementation of This was originally prompted by this comment #1145 (comment) . I'd be interested to hear if this PR fixes that issue. And if it does whether removing the part that filters out non-local packages causes the issue to return. If the local packages filtering is crucial to solving this performance regression, I could implement something that filters by local packages when only local packages are selected and don't filter otherwise. |
I can confirm this makes it much faster. Sorry, I don't have the cycles right now to think about whether it's a good idea 😅 |
No worries! My thinking now is that we should change the key to something like the Something like this maybe:
How does that sound? |
That sounds like an awesome idea! I remember a year or two ago we refactored something (I think it was the code that gathers inputs for the haskell derivations) so that it did not use |
I guess there's a risk that that might not be a unique key? Whereas the out path is going to be unique. Probably the derivation name (which would be a combination of package name and version, I think) ought to do it, though! |
We no longer force the `outPath` attribute to avoid instantiating the derivation, which is expensive
I've force pushed commits with the idea I mentioned. I think I'm using the derivation name as the key, so hopefully that will be unique enough |
bors try |
tryBuild succeeded: |
* factor out isSelectedComponent * Optimise `flatLibDepends` We no longer force the `outPath` attribute to avoid instantiating the derivation, which is expensive
Improves performance of #1145 by only traversing local packages in search of components to add to
selectComponents
.Let me know if you have any suggestions