Skip to content

Data.Graph.bcc is not efficient #900

Open
@meooow25

Description

@meooow25
  • The collect function recursively concats on a tree, making the time complexity quadratic. This can be avoided using difference lists.
  • The do_label step builds some unnecessary intermediate trees, similar to the dfs we had (Optimizing DFS in Data.Graph #882).

I'm not aware of common use cases for bcc, so I'm not sure if this affects anyone.
But as long we have it, we should make it efficient.

I can send a PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions