Avoid logging information by-default and never discarding such logs

The analyzer wraps various functionality in logging calls like

    await logger.runAsync('Prepare linked bundles', () async {
      ...
    });

Doing so will cause time being measured and begin/end messages to be
written to a log. Those strings accumulate in a `StringBuffer` that
is never accessed.

For example running analyzer on a big app like flutter can cause
thousands of "--- Prepare linked bundles in 0 ms.  " strings to be
generated and hanged on to.

This CL makes us no longer generate such strings - only if the
creator of a context supplies a [PerformanceLog] explicitly (in which case
it is responsible for draining the messages written to it).

This reduces memory consumption when analyzing flutter by around 3 MB.

TEST=ci

Change-Id: I4979a964f13c63bd2a3cccef97fb702431731139
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254925
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
diff --git a/pkg/analyzer/lib/src/dart/analysis/context_builder.dart b/pkg/analyzer/lib/src/dart/analysis/context_builder.dart
index 9dcf26e..f6b186c 100644
--- a/pkg/analyzer/lib/src/dart/analysis/context_builder.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/context_builder.dart
@@ -81,7 +81,7 @@
     }
 
     byteStore ??= MemoryByteStore();
-    performanceLog ??= PerformanceLog(StringBuffer());
+    performanceLog ??= PerformanceLog(null);
 
     if (scheduler == null) {
       scheduler = AnalysisDriverScheduler(performanceLog);