Skip to content

Slow exportReferencesGraph #11791

Open
Open
@roberth

Description

This computeFSClosure call is very inefficient, because

  • it is called for each .drv in the closure (e.g. over 4000 times in my case)

  • it recomputes the whole closure, because the second parameter is only written to. computeFSClosure/computeClosure should probably not assume that the closure property holds for this res set; that seems risky

It seems to lead to O(n²) cost.

Perhaps these paths could be gathered up in a set, and then run computeFSClosure on that set?

It is very tempting to just set includeOutputs = true, and be done with it, but that would silently ignore missing outputs, which could lead to a build impurity if not checked.

To reproduce with Nixpkgs,

nix-build -A nixosTests.nixos-rebuild-target-host

I'll open an issue.

Originally posted in 2897286

Metadata

Assignees

No one assigned

    Labels

    derivation-buildThe process of building an individual derivation (see also sandbox label)performancestoreIssues and pull requests concerning the Nix store

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions