-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Currently subblocks are not added with addNode directly, but as part of their file dags. Currently, dir-file recursion happens via calls to addNode, and subblock recursion happens when addNode (on a file) calls DAG.AddRecursive(nd).
The fact that addNode calls DAG.AddRecursive(nd) means it will try to add nodes again and again as addNode is called with parent dirs. The two alternatives are to either do everything with recursive backtracking, or generate the whole dag first, and then call DAG.AddRecursively(root). The former approach is less memory intensive (as the whole DAG does not need to be in memory) and parallelizes better, as can work on siblings simultaneously (without relying on the parallelism being inside DAG.AddRecursively).
Two related changes needed:
- The file-sublock recursion should be the same as dir-file recursion (i.e. calling
addNodeon the subblock). addNodeshould callDAG.Add(nd)