Files
sdk/pkg/analyzer_cli
Jens Johansen 2c0648dd7d [analyzer cli] Don't ask for errors on the same file several times
```
$ out/ReleaseX64/dart pkg/front_end/tool/benchmarker.dart --silent --iterations=10 --gcs=5 --snapshot=pkg/analyzer_cli/bin/analyzer.aot.1 --snapshot=pkg/analyzer_cli/bin/analyzer.aot.2 --arguments="/tmp/extracted_compile_dart_compile/"
Will now run 10 iterations with 2 snapshots.
..............................

Comparing snapshot #1 (analyzer.aot.1) with snapshot #2 (analyzer.aot.2)
msec task-clock:u: -7.7915% +/- 1.2399% (-851.98 +/- 135.58) (10934.74 -> 10082.76)

page-faults:u: -1.7454% +/- 1.1131% (-2457.20 +/- 1566.98) (140777.80 -> 138320.60)
cycles:u: -5.6010% +/- 1.2559% (-2318118149.50 +/- 519783195.96) (41387425609.80 -> 39069307460.30)
instructions:u: -7.0130% +/- 0.5970% (-3636754009.20 +/- 309595118.25) (51857207312.90 -> 48220453303.70)
branch-misses:u: -6.2869% +/- 4.5941% (-9795625.90 +/- 7158088.69) (155810738.90 -> 146015113.00)
seconds time elapsed: -7.7884% +/- 1.2389% (-0.85 +/- 0.14) (10.94 -> 10.09)
seconds user: -6.0176% +/- 1.4855% (-0.59 +/- 0.14) (9.75 -> 9.16)
seconds sys: -22.3326% +/- 4.4197% (-0.27 +/- 0.05) (1.19 -> 0.92)
Comparing GC:
No change in combined time.
```
Change-Id: Ibb34829a42770c22567bc1399bcf7eaf26201e99
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/449121
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
2025-09-11 05:45:20 -07:00
..

SDK development code analysis

dartanalyzer used to be the tool for statically analyzing dart code at the command line. However, this tool has been replaced with dart analyze for this purpose in current SDKs and will no longer be published on pub.

Do not depend on the command line interface or other semantics in this directory as it is now an internal tool for SDK development, used as the dart2analyzer "compiler" for tools/test.py in the SDK. It is configured as part of the test runner, here.

SDK development usage

For SDK development, run analysis from the test tool to validate analysis conclusions on language samples in the testing directory. From the root of the SDK:

tools/test.py --build --use-sdk -c dart2analyzer co19 language

This will build the Dart VM and compile dartanalyzer into a snapshot, then use that snapshot while analyzing those directories under testing/. Without --use-sdk, test.py will use the source code version of the analyzer instead of the compiled one, which can be useful for debugging.