Open rainersigwald opened 2 years ago
The workaround here is that the custom delegate providing user can create and use their own EvaluationContext instance when their delegate gets called. That's how QB does it.
On the other hand it would be nice if static graph construction did this by default. I can't think of any scenario where you wouldn't want automatic caching (unless your memory is really constrained ...), and there's a high probability that potential static graph users might not know about EvaluationContexts.
unless your memory is really constrained
If my memory were constrained, I would be more worried about the accumulation of ProjectInstance
objects that the graph creates and never releases during the graph traversal.
Discussed offline with @AArnott and @cdmihai.
When building the static graph, I/O can be a bottleneck for evaluating the many projects that get put into the graph. The existing
EvaluationContext
allows sharing filesystem enumerations and other operations and would potentially speed up evaluation (especially of heavily multitargeted solutions).This may not be trivial (from @cdmihai):
Even if we can't make this fully generalizable, we should consider using an
EvaluationContext
for the default-behavior "don't specify your own delegate" case