Skip to content
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

Simulation: Performance improvement ideas #9

Open
stklik opened this issue Apr 17, 2019 · 1 comment
Open

Simulation: Performance improvement ideas #9

stklik opened this issue Apr 17, 2019 · 1 comment
Assignees

Comments

@stklik
Copy link
Member

stklik commented Apr 17, 2019

The Simulator is a bit slow. There are many calls to Z3 that aren't necessary.
For example, the simulator is also called when there is no Update in the modifiers chain.
No update -> no timed change -> don't run Z3

Also:
If dt is not part of any modifier constraint -> no timed change -> don't run Z3

Also:
Only add the modifiers backwards until the update. any influence before the update can be ignored, since their behaviour (output value) will not change
This reduces the size of modifiers.
fewer constraints -> faster Z3 (I guess).

The problem lies in the efficient discovery of these conditions.
For example, how can we find out if dt is used in an update function without converting its constraints to string (slow), accessing its source code (slow) or going through the constraint ASTs (also slow, maybe?).

There should be some great caching somewhere (e.g. the source code's?)

@stklik stklik self-assigned this Apr 17, 2019
@stklik
Copy link
Member Author

stklik commented Apr 18, 2019

Another one: Replace get_modifier_map in the simulator with the networkx approach.
The graphs will be created for the dependency order anyway, so we might as well use these operations instead of creating the graph it manually.

I also hope this is faster, but we'll see.

@stklik stklik changed the title Performance improvement ideas Simulation: Performance improvement ideas Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant