Commit 8a3a773
perf(libstore/derivation-builder): pre-compute outputGraph for linear complexity
Build the inverse of `scratchOuputs` before running topoSort, avoiding
quadratic complexity when determining which outputs reference each
other. This fixes the FIXME comment about building the inverted map up
front.
Inspired by Lix commit 10c04ce84 / Change Id
Ibdd46e7b2e895bfeeebc173046d1297b41998181, but ended up being completely
different code.
Co-Authored-By: Maximilian Bosch <[email protected]>
Co-Authored-By: Bernardo Meurer Costa <[email protected]>1 parent 423e732 commit 8a3a773
1 file changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1398 | 1398 | | |
1399 | 1399 | | |
1400 | 1400 | | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
1401 | 1406 | | |
1402 | 1407 | | |
1403 | 1408 | | |
| |||
1486 | 1491 | | |
1487 | 1492 | | |
1488 | 1493 | | |
1489 | | - | |
1490 | 1494 | | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
| 1495 | + | |
| 1496 | + | |
1494 | 1497 | | |
1495 | 1498 | | |
1496 | 1499 | | |
| |||
0 commit comments