[analyzer] Initial LSP server e2e benchmark

A benchmark that launches the dart analyzer server in language server
protocol mode and communicates with is as an IDE.
In this case the benchmark generates between 16 and 1024 copies of the
abstract scanner (to get a large amount of code) as well as imports and
exports all the files in cycles and/or chains; performs an edit,
requests completion and times initial startup (with no cache),
completion after change and when it's done analyzing after the change.

It does this in several modes than change the way the files are imported
and exported:
* ImportCycle where file1 imports file2 etc and the last file imports
  file1. There are no exports.
* ImportChain where file1 imports file2 etc and the last file doesn't
  import anything. There are no exports.
* ImportExportCycle where file1 imports and exports file2 etc and the
  last file imports and exports file1.
* ImportExportChain where file1 imports and exports file2 etc and the
  last file doesn't import or export anything.
* ImportCycleExportChain where file1 imports and exports file2 etc and
  the last file imports file1 but doesn't export anything.

For ImportCycle, ImportChain and ImportExportChain things appear to
scale ~linear and - using AOT - have timeings in this ballpark (this is
specifically for ImportCycle):

+------+-----------+------------+------------+
| Size |  Initial  | Completion | Fully done |
+------+-----------+------------+------------+
|   16 |   0.46561 |   0.158765 |    0.40474 |
|   32 |  0.901167 |   0.268819 |   0.859874 |
|   64 |  1.657207 |   0.428747 |   1.488365 |
|  128 |  3.178606 |   0.843576 |   3.040237 |
|  256 |  6.015557 |   1.737661 |   6.010487 |
|  512 |  12.08567 |   2.979242 |  11.736878 |
| 1024 | 24.273368 |   6.101671 |  24.018495 |
+------+-----------+------------+------------+

For ImportExportCycle and ImportCycleExportChain it scales worse and
e.g. ImportExportCycle looks like this:

+------+-----------+------------+------------+
| Size |  Initial  | Completion | Fully done |
+------+-----------+------------+------------+
|   16 |   0.46673 |   0.169486 |   0.406448 |
|   32 |  0.875871 |   0.242876 |    0.85543 |
|   64 |  1.583077 |   0.465915 |   1.506953 |
|  128 |  3.198071 |   0.903894 |    3.09165 |
|  256 |  6.786677 |   2.149489 |   6.779569 |
|  512 | 17.346131 |    8.92149 |  17.971033 |
| 1024 | 63.358453 |  46.152089 |  65.401559 |
+------+-----------+------------+------------+

(In the tables 'Completion' is time until completion answers after a
top-level change and 'Fully done' is time until the analyzer stops
analyzing after a top-level change).

Change-Id: Id7214c0d6c14199f39c0c8a6a8b4941a0e575dc3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/413401
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
16 files changed
tree: 5d2c948a22557794856b920d6bce6aa9a6840d26
  1. .dart_tool/
  2. .github/
  3. benchmarks/
  4. build/
  5. docs/
  6. pkg/
  7. runtime/
  8. samples/
  9. sdk/
  10. tests/
  11. third_party/
  12. tools/
  13. utils/
  14. .clang-format
  15. .gitattributes
  16. .gitconfig
  17. .gitignore
  18. .gn
  19. .mailmap
  20. .style.yapf
  21. AUTHORS
  22. BUILD.gn
  23. CHANGELOG.md
  24. codereview.settings
  25. CONTRIBUTING.md
  26. DEPS
  27. LICENSE
  28. OWNERS
  29. PATENT_GRANT
  30. PRESUBMIT.py
  31. README.dart-sdk
  32. README.md
  33. sdk.code-workspace
  34. sdk_args.gni
  35. sdk_packages.yaml
  36. SECURITY.md
  37. WATCHLISTS
README.md

Dart

An approachable, portable, and productive language for high-quality apps on any platform

Dart is:

  • Approachable: Develop with a strongly typed programming language that is consistent, concise, and offers modern language features like null safety and patterns.

  • Portable: Compile to ARM, x64, or RISC-V machine code for mobile, desktop, and backend. Compile to JavaScript or WebAssembly for the web.

  • Productive: Make changes iteratively: use hot reload to see the result instantly in your running app. Diagnose app issues using DevTools.

Dart's flexible compiler technology lets you run Dart code in different ways, depending on your target platform and goals:

  • Dart Native: For programs targeting devices (mobile, desktop, server, and more), Dart Native includes both a Dart VM with JIT (just-in-time) compilation and an AOT (ahead-of-time) compiler for producing machine code.

  • Dart Web: For programs targeting the web, Dart Web includes both a development time compiler (dartdevc) and a production time compiler (dart2js).

Dart platforms illustration

License & patents

Dart is free and open source.

See LICENSE and PATENT_GRANT.

Using Dart

Visit dart.dev to learn more about the language, tools, and to find codelabs.

Browse pub.dev for more packages and libraries contributed by the community and the Dart team.

Our API reference documentation is published at api.dart.dev, based on the stable release. (We also publish docs from our beta and dev channels, as well as from the primary development branch).

Building Dart

If you want to build Dart yourself, here is a guide to getting the source, preparing your machine to build the SDK, and building.

There are more documents in our repo at docs.

Contributing to Dart

The easiest way to contribute to Dart is to file issues.

You can also contribute patches, as described in Contributing.

Roadmap

Future plans for Dart are included in the combined Dart and Flutter roadmap on the Flutter wiki.