py-aiger
py-aiger copied to clipboard
Speed up composition
Currently, composition seems to scale super linearly in the size of the circuit. The appears to also hold true for all functions that rely on modify_leafs
https://github.com/mvcisback/py-aiger/blob/master/aiger/aig.py#L246
This function performs a recursive traversal of the DAG and modifies the leafs. However, currently this results in the entire DAG being rebuilt with each call of modify_leafs
.
The proposal is to use a persistent datastructure that allows for targeted changes to the DAG.
Pyrsistent seems promising. Changing the NamedTuples
with PRecords
may do the trick.