pubgrub-rs / pubgrub

PubGrub version solving algorithm implemented in Rust
https://pubgrub-rs.github.io/pubgrub/pubgrub/
Mozilla Public License 2.0
337 stars 30 forks source link

Allocating more than we need to in `DerivationTree::Derived` #117

Closed Eh2406 closed 3 months ago

Eh2406 commented 2 years ago

In v0.2 DerivationTree::Derived uses a Box to point to its children, which makes it strictly a tree. However any time there is a shared_id then the tree stores in memory to full copies of the shared portion. It is more accurately a DAG. We should consider storing each cause in a RC (or maybe an ARC) so that nodes that have the same shared_idare stored in the same place in memory.

Eh2406 commented 3 months ago

cc #184