You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using stormvogel to build slightly big models again (~20 000 states), and I have come across some small issues that slow down model building a lot. I have listed them from most to least impact I think.
model.py: Model.__free_state_id this is O(n). I fix this temporarily by using return len(self.states), but that might not be safe in all situations.
pgc.py: The build_pgc function keeps track of a states_seen: list variable and a state_lookup: tuple variable. Then many existence checks are done on states_seen. These checks could be done on state_lookup and would probably be faster there. Looping over states_seen can also be done on state_lookup
model.py: Model.__init__ has an O(n) loop over the size of the model. This is again a big bottleneck if the model becomes larger.
I hope these are clear descriptions of my bottlenecks :)
The text was updated successfully, but these errors were encountered:
In State.__init__ the check if a name is already used in the model, together with the check if the id can be used as a name. That does seem like a very useful check, but maybe giving an unsafe fast flag? Or at least using a set for used_names.
I am using stormvogel to build slightly big models again (~20 000 states), and I have come across some small issues that slow down model building a lot. I have listed them from most to least impact I think.
model.py
:Model.__free_state_id
this is O(n). I fix this temporarily by usingreturn len(self.states)
, but that might not be safe in all situations.pgc.py
: Thebuild_pgc
function keeps track of astates_seen: list
variable and astate_lookup: tuple
variable. Then many existence checks are done onstates_seen
. These checks could be done onstate_lookup
and would probably be faster there. Looping overstates_seen
can also be done onstate_lookup
model.py
:Model.__init__
has an O(n) loop over the size of the model. This is again a big bottleneck if the model becomes larger.I hope these are clear descriptions of my bottlenecks :)
The text was updated successfully, but these errors were encountered: