Commit 7b7e555
perf(libstore/derivation-builder): pre-compute outputGraph for linear complexity
Build the output reference graph and inverse output map 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.
The outputGraph (StorePath → StorePathSet) maps each output to its
references, and will be reused in future commits to generate detailed
cycle error messages showing which files contain problematic references.
Adapted from Lix commit 10c04ce84.
Change-Id: Ibdd46e7b2e895bfeeebc173046d1297b41998181
Co-Authored-By: Maximilian Bosch <[email protected]>1 parent 87a2ce4 commit 7b7e555
1 file changed
+33
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1470 | 1470 | | |
1471 | 1471 | | |
1472 | 1472 | | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
| 1495 | + | |
| 1496 | + | |
| 1497 | + | |
1473 | 1498 | | |
1474 | | - | |
1475 | | - | |
1476 | | - | |
1477 | | - | |
1478 | | - | |
1479 | | - | |
1480 | | - | |
1481 | | - | |
1482 | | - | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
1498 | 1507 | | |
1499 | 1508 | | |
1500 | 1509 | | |
| |||
0 commit comments