Skip to content

spack diff has exponential complexity #51253

@haampie

Description

@haampie

Steps to reproduce

spack diff /x /y

recurses through all possible paths, which means worst case O(2^N) complexity for a DAG with N nodes with edges v_i -> v_j if i < j.

This is due to unconditional

dependency_clauses = self._spec_clauses(
dep,
body=body,
expand_hashes=expand_hashes,
concrete_build_deps=concrete_build_deps,
context=context,
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageThe issue needs to be prioritized

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions