anchor.diff:  
   /// Sets up analyzer to be able to load and resolve app, packages, and sdk
   /// sources.
  -void setup(Uri packageRoot) {
  +Future setup(Uri entryUri) async {
     var provider = PhysicalResourceProvider.INSTANCE;
     var packageMap = new ContextBuilder(provider, null, null)
  -      .convertPackagesToMap(getPackagesDirectory(packageRoot));
  +      .convertPackagesToMap(await findPackages(entryUri));
     sources = new SourceFactory([
       new ResourceUriResolver(provider),
       new PackageMapUriResolver(provider, packageMap),
  
positive.code: import 'package:analyzer/src/generated/source_io.dart';
  import 'package:package_config/discovery.dart';
  
  /// Cummulative total number of chars scanned.
  int scanTotalChars = 0;
  
  /// Cummulative time spent scanning.
  Stopwatch scanTimer = new Stopwatch();
  
  /// Factory to load and resolve app, packages, and sdk sources.
  SourceFactory sources;
  
  main(args) {
    // TODO(sigmund): provide sdk folder as well.
    if (args.length < 3) {
      print('usage: perf.dart <bench-id> <package-root> <entry.dart>');
      exit(1);
    }
    var totalTimer = new Stopwatch()..start();
  
    var bench = args[0];
    var packageRoot = Uri.base.resolve(args[1]);
    var entryUri = Uri.base.resolve(args[2]);
  
    setup(packageRoot);
    if (bench == 'scan') {
      scanReachableFiles(entryUri);
    } else if (bench == 'parse') {
      Set<Source> files = scanReachableFiles(entryUri);
      parseFiles(files);
    } else {
      print('unsupported bench-id: $bench. Please specify "scan" or "parse"');
      // TODO(sigmund): implement the remaining benchmarks.
  
negative.code:   report("load", loadTime);
    report("scan", scanTimer.elapsedMicroseconds);
    return files;
  }
  
  /// Scans every file in [files] and reports the time spent doing so.
  void scanFiles(Set<Source> files) {
    // The code below will record again how many chars are scanned and how long it
    // takes to scan them, even though we already did so in [scanReachableFiles].
    // Recording and reporting this twice is unnecessary, but we do so for now to
    // validate that the results are consistent.
    scanTimer = new Stopwatch();
    var old = scanTotalChars;
    scanTotalChars = 0;
    for (var source in files) {
      tokenize(source);
    }
  
    // Report size and scanning time again. See discussion above.
    if (old != scanTotalChars) print('input size changed? ${old} chars');
    report("scan", scanTimer.elapsedMicroseconds);
  }
  
  /// Parses every file in [files] and reports the time spent doing so.
  