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

Add more specialization for the case where a call to update is pulled from the queue #36

Open
georgematheos opened this issue Nov 6, 2020 · 0 comments

Comments

@georgematheos
Copy link
Owner

Whenever a call to update is updated off the update queue, rather than during a recursive call, we are guaranteed that every value u this call v looked up in the previous world has already been updated, and thus we have all diff information for it. Furthermore, when we updated each previous call u, we enqueued v to be updated--so at nearly no additional cost, at this time, we could add u to a set of diffed dependencies for v. Then, when we update v, rather than just looking at the world.state.diffs containing all diffs in the world, we can look specifically at the diffs for dependencies of v.

I have in mind at least 2 ways that this could improve performance. One is that for mgfcall_map, etc., we currently scan all the diffs in the world to find which looked-up keys have had their values changed; it would be faster to know exactly what the diffs are for the function with the mgfcall_map. Another is that it might be possible to have different types of WorldUpdateDiff, eg. having WorldUpdateDiff{changed_calls} where changed_calls is a tuple of all the changed calls which the generative function it is passed to depended on. This would enable static generative functions to specialize to the specific diffs of its dependencies (at least according to the previous world state).

One reason this change may not be very significant is that presumably, most updates are changing variables which are all related in some way, and thus a lot of the time, all/almost all of the variables diffed in the world are dependencies of things we update in the future.

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

1 participant