The analyzer driver currently allocates a new closure and delegate for every symbol declared:
|
private static Action<Diagnostic> GetAddDiagnostic( |
This is one example of a couple of places where we allocate memory in proportion of the number of symbols declared in the compilation. Symbols are extremely common in the compiler and this can represent a very heavy allocation burden. We should try to make all analyzer APIs allocate a constant amount when possible, or re-use as many allocations as possible.