8000 pgc builder speed issues · Issue #304 · moves-rwth/stormvogel · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

pgc builder speed issues #304

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lukovdm opened this issue May 15, 2025 · 2 comments
Open

pgc builder speed issues #304

lukovdm opened this issue May 15, 2025 · 2 comments
Assignees

Comments

@lukovdm
Copy link
lukovdm commented May 15, 2025

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.

  1. 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.
  2. 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
  3. 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 :)

@PimLeerkes PimLeerkes self-assigned this May 22, 2025
@PimLeerkes
Copy link
Collaborator

Fixing the first two seems to increase the efficiency a lot! but what do you mean exactly by the O(n) loop in Model.init?

@PimLeerkes PimLeerkes linked a pull request May 22, 2025 that will close this issue
@PimLeerkes PimLeerkes removed a link to a pull request May 22, 2025
@lukovdm
Copy link
Author
lukovdm commented May 22, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0