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

Why run tasks in graph based on layers? #18

Open
sroussey opened this issue Jan 18, 2025 · 1 comment
Open

Why run tasks in graph based on layers? #18

sroussey opened this issue Jan 18, 2025 · 1 comment

Comments

@sroussey
Copy link
Owner

I did this at one point for the purpose of doing certain kind of pipelines, but this is not the most efficient for the general case, so make this optional and do the easier thing in the general case.

@sroussey
Copy link
Owner Author

Ah yes, I remember now, and should doc this somewhere. When you have a DAG (and that is all we deal with at the moment), having a dependency graph organized in layers is a fast way to run the calculations assuming they are all about the same amount of work.

This is the case for the reactive stuff.

For the processing stuff... well, maybe not. Processing stuff that is long running async will likely run better if you get the first layer and run that in parallel, then notify dependents and when processing done. The dependent would then wait for all the parents to complete before running. This would let later layers start processing sooner rather than waiting for all parents siblings to be done.

To do the above will require some work though... you could use the fact that the DataFlow (edges) have a value and if that value is not the default, then it has been processed. Or the DataFlow can have things explicit rather than implicit and have a status. Explicit is usually easier to understand and debug, and it could help if we want to have partial data flow results and values.

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