Analysis Server Benchmark Scenarios

This document explains the benchmark scenarios in pkg/analysis_server/tool/benchmark_tools/: what real IDE or CLI behavior each one models, who is affected, and how its numbers relate to real repositories. Synthetic benchmarks are easy to dismiss as contrived, or to over-optimize, unless their inputs are tied to real workflows. Benchmarks that analyze real code do not have this problem, but their inputs change over time, so it has to be clear which numbers can be compared.

Warm startup of a multi-package workspace with IDE excludes

single_benchmarks/warm_startup_multi_package_with_ide_excludes.dart

out/ReleaseX64/dart-sdk/bin/dart \
  pkg/analysis_server/tool/benchmark_tools/single_benchmarks/warm_startup_multi_package_with_ide_excludes.dart

It accepts only --dart=<path> and --json; the scenarios and the sweep are fixed in code, so every run produces the same comparable report.

What it simulates

A pub workspace with 25, 50, or 100 packages, 50 small Dart libraries per package, one shared .dart_tool/package_config.json, opened as a single included root. For each package count, four scenarios run AOT dart language-server with a persistent disk cache (--cache):

  • legacy_3p_excludes: --protocol=analyzer, 3 excludes per package (<package>/.dart_tool, <package>/.pub, <package>/build) sent in analysis.setAnalysisRoots. This is IntelliJ and Android Studio today.
  • legacy_no_excludes: --protocol=analyzer, no excludes. This is the control for legacy_3p_excludes.
  • lsp_3p_excludes: --protocol=lsp, the same excludes sent as analysisExcludedFolders in the workspace/configuration response. VS Code sends none by default (Dart-Code 3.147), so this models users who configured excludes, and a possible future IntelliJ client that uses LSP.
  • lsp_no_excludes: --protocol=lsp, no excludes. This is the control for lsp_3p_excludes, and the default for VS Code.

Each scenario first runs a cold analysis to fill the cache, then 3 fresh server processes against the filled cache. The measured time is from sending analysis.setAnalysisRoots (legacy) or initialized (LSP) until analysis finishes, so it includes root discovery, file listing, and watcher setup, but not process launch.

The workspace root path is padded to 64 characters, and the report prints the actual length. The server compares paths character by character, so without padding the result would depend on the temp directory: on one Linux machine, a 128-character common prefix of the package paths instead of an 80-character one raised the exclude overhead at 100 packages from 1,059 ms to 1,533 ms.

Why these inputs happen

  • IntelliJ and Android Studio run the analysis server with the legacy protocol, and bridge LSP features in process (lsp/ABOUT.md). On project open, DartStartupActivity finds every pubspec.yaml in the project and excludes .dart_tool, .pub, and build next to it (DartStartupActivity.kt#L166-L180, #L246-L247). DartServerRootsHandler sends every module content root as included, and every excluded folder of it, except packages, as excluded (DartServerRootsHandler.java#L88-L101).
  • With LSP, LspAnalysisServer applies each relative entry of dart.analysisExcludedFolders to every workspace folder, so the number of excluded paths is the number of entries times the number of workspace folders. Both protocols pass the included and excluded paths to the same AbstractNotificationManager and ContextManager.

The server checks every analyzed file against every included and excluded root, in AbstractNotificationManager._isIncluded and ContextRootImpl._isExcluded, and against every package of the package config, in Packages.packageForPath. Each check scans the paths character by character, so the cost of the root checks is proportional to fileCount * (includedCount + excludedCount) * pathLength. Here the number of files and the number of excludes both grow with the number of packages, so the cost grows quadratically.

Who is affected

  • Affected: IntelliJ and Android Studio users with a multi-package repository in one window (pub workspaces, melos monorepos, Flutter plugins with example/ and subpackages, multi-module projects), and VS Code users with many workspace folders or with dart.analysisExcludedFolders.
  • Not meaningfully affected: one package opened alone (1 included root, at most 3 excludes). There, isWithin is about 2–3% of warm startup (about 60 ms for pkg/analyzer on an Apple M4 Pro).

Metrics

  • Primary: warm initial analysis time, median of 3 runs, for each scenario and package count.
  • Headline: the exclude overhead, the warm median of a scenario with excludes minus that of the scenario without excludes with the same protocol, printed as a separate table. The protocols differ in costs that do not depend on the excludes: for example, the legacy server sends analysis.errors for every file, even without errors, while the LSP server publishes diagnostics only for files that have them. Fixes should bring it close to zero at every package count. If it grows with the package count again, that is a regression. A change that speeds up every file, with or without excludes, also speeds up the control, so the overhead does not show it; compare the warm medians too.

The generated libraries are tiny, so reading, linking, and diagnostics cost much less than in real code. Relative speedups here are therefore much larger than in real repositories. Report the absolute milliseconds saved, and check the real impact on a real repository, as in the calibration below.

Real-world calibration

The Dart SDK repository, opened in IntelliJ, sends 32 included and 292 excluded roots (96 packages times .dart_tool, .pub, and build, plus 4 others); 6,618 files are analyzed, and the package config has 190 packages. Replaying that analysis.setAnalysisRoots payload against AOT dart language-server --protocol=analyzer with a filled cache (commit 256206b002e, 2026-11-20, macOS, Apple M4 Pro):

  • Warm startup: median 6,320 ms (runs: 6,706, 6,306, 6,320 ms).
  • In a separate run under the sampling profiler (250 µs period), isWithin takes about 24% of CPU (about 1.5 s of the 6.3 s), two thirds of it in AbstractNotificationManager._isIncluded.
  • Control: pkg/analyzer alone (1,625 files, no excludes) has a warm median of 1,984 ms, of which isWithin is about 3% (about 60 ms). Adding 496 excludes raises the median to 2,250 ms and isWithin to about 18%.

After the optimizations below, the same IntelliJ project was replayed on Linux x64 (AMD Ryzen 9 PRO 8945HS), with the server from before the optimizations (f3091555445) and the server after CL 580840 (product AOT, 3 interleaved rounds of 3 warm runs, mean of the warm medians). The payload is built from the .iml files of the project, as DartServerRootsHandler does: the content root of each module with the Dart SDK enabled is included, and its excluded folders and the .idea directory of the project are excluded. Six modules whose .iml files are not in this checkout, three of them outside the repository, are left out, which gives 30 included and 287 excluded roots.

ScenarioBeforeAfter
With the excludes5,022 ms3,724 ms (−26%)
The same included roots, without excludes3,967 ms3,755 ms (−5%)
Exclude overhead+1,055 ms−31 ms

After the optimizations the overhead is negative, because without the excludes the server also analyzes the files in the excluded folders.

The same replay on macOS (Apple M4 Pro, 32 included and 292 excluded roots, 6,720 analyzed files, product AOT from the same commits, 3 interleaved rounds of 3 warm runs against a shared filled cache) hits frequent +1,000 ms retries inside analysis.setAnalysisRoots when registering 32 FSEvents watchers (TimerUtils::Sleep(1000) in runtime/bin/file_system_watcher_macos.cc, occurring on 20 of the 36 runs, including one 10-second spike). Combining the median 0-retry analysis.setAnalysisRoots response time with the median post-analysis.setAnalysisRoots analysis time across all 9 warm runs (taking the median of only the 0-retry runs directly gives 6,955 → 5,410 ms, −22%):

ScenarioBeforeAfter
With the excludes6,960 ms5,466 ms (−21%)
The same included roots, without excludes5,736 ms5,457 ms (−5%)
Exclude overhead+1,224 ms+9 ms

The −1,494 ms saved with excludes matches the ~1.5 s sampling-profiler estimate above; the percentage is smaller than on Linux (−21% vs −26%) because macOS pays ~2.3 s in analysis.setAnalysisRoots watcher setup even at 0 retries. Both scenarios analyze the same 6,720 files here (the only existing non-dot excluded directory with Dart files is pkg/front_end/testcases, already excluded by pkg/front_end/analysis_options_no_lints.yaml), so the exclude overhead drops to noise (+9 ms) rather than turning negative.

Baseline before the optimizations

Linux x64, AMD Ryzen 9 PRO 8945HS, 2026-11-21, server from an SDK built at 51133fc5559 (2026-11-18), workspace root path length 64.

ScenarioPackagesFilesExcludedColdWarm runs (ms)Warm median
legacy_3p_excludes251250751025 ms262, 261, 264262 ms
lsp_3p_excludes251250751073 ms251, 248, 253251 ms
lsp_no_excludes2512500993 ms182, 183, 183183 ms
legacy_3p_excludes5025001502098 ms675, 659, 653659 ms
lsp_3p_excludes5025001502059 ms627, 621, 620621 ms
lsp_no_excludes50250001823 ms367, 369, 367367 ms
legacy_3p_excludes10050003004759 ms1786, 1780, 18051786 ms
lsp_3p_excludes10050003004623 ms1751, 1741, 17711751 ms
lsp_no_excludes100500003624 ms727, 707, 719719 ms

Exclude overhead:

Packageslegacy_3p_excludeslsp_3p_excludes
25+79 ms+68 ms
50+292 ms+254 ms
100+1067 ms+1032 ms

Each doubling of the package count multiplies the overhead by about 3.7–4.1, consistent with quadratic growth. At 100 packages, the excludes take 59% of the warm startup. With a 48-character TMPDIR, the overhead at 100 packages was +1073 ms and +1019 ms, so the padding works.

Here and in the Optimizations entries below, up to “A control for each protocol”, the overhead of both scenarios was computed against lsp_no_excludes. So the overhead of legacy_3p_excludes there includes costs of the legacy protocol that do not depend on the excludes: 58 ms at 100 packages with the server of CL 580800.

Optimizations

Each entry is measured against its parent commit, on the machine of the baseline above (product AOT, mean of 2 interleaved rounds). Profiles are of the whole server process, from launch to exit, all threads, in the 3 warm runs of lsp_3p_excludes at 100 packages (non-product AOT, perf record -e instructions:u -c 1000000 -g, mean of the 3 runs). A row “with callees” counts every sample that has that code anywhere on its stack, including inlined frames. With smaller sampling periods the kernel throttles sampling, and the profile undercounts by up to 3 times; with this one, the totals match perf stat within 1%. Without perf, the non-product server's warm medians are within 1% of the product ones, so the profiles represent the product build.

CL 580541: Cache AbstractNotificationManager._isIncluded per file path

_isIncluded ran for every analysis result, twice for the first result for each file. Its result depends only on the path and the analysis roots, so it is now cached per path, and the cache is cleared when the roots change.

Warm medians:

Packageslegacy_3p_excludeslsp_3p_excludeslsp_no_excludes
25266 → 241 ms252 → 226 ms184 → 184 ms
50651 → 561 ms625 → 533 ms367 → 369 ms
1001779 → 1437 ms1758 → 1381 ms713 → 710 ms

Exclude overhead:

Packageslegacy_3p_excludeslsp_3p_excludes
2582 → 57 ms68 → 42 ms
50285 → 193 ms258 → 165 ms
1001066 → 728 ms1045 → 672 ms

Profile:

BeforeAfterChange
All server instructions29.73G21.73G−27%
AbstractNotificationManager._isIncluded, with callees16.21G (54.5%)8.08G (37.2%)−50%
ContextRootImpl._isExcluded, with callees6.37G (21.4%)6.51G (30.0%)unchanged
package:path code, with callees22.67G (76.2%)14.71G (67.7%)−35%

After this change, isWithin reached from _isIncluded (36.8%, once per file, but still over all included and excluded paths) and in ContextRootImpl._isExcluded (23.4%) is most of the remaining path cost.

CL 580600: Scan names under the root once in ContextRootImpl._isExcluded

Files and folders whose name, or the name of an ancestor under the context root, starts with . are excluded. This was checked by walking the ancestors with Folder.contains, Context.basename, and Context.dirname, each parsing the whole path, for every file, with or without excludes; now the names after the root are scanned once.

Warm medians:

Packageslegacy_3p_excludeslsp_3p_excludeslsp_no_excludes
25241 → 226 ms226 → 213 ms183 → 170 ms
50554 → 534 ms529 → 508 ms364 → 339 ms
1001420 → 1388 ms1383 → 1331 ms708 → 685 ms

Exclude overhead:

Packageslegacy_3p_excludeslsp_3p_excludes
2559 → 56 ms43 → 43 ms
50190 → 195 ms165 → 170 ms
100713 → 703 ms676 → 646 ms

The overhead does not change, because the check runs for every file in every scenario, including lsp_no_excludes.

Profile:

BeforeAfterChange
All server instructions21.73G20.70G−5%
ContextRootImpl._isExcluded, with callees6.51G (30.0%)5.51G (26.6%)−15%
Ancestor walk in _isExcluded (Context.basename, Context.dirname, Folder.contains)0.98G (4.5%)none
ContextRootImpl._hasDotNameUnderRoot, with calleesnone0.013G (0.06%)
Fallback walk of the ancestorsnone0 samples
package:path code, with callees14.71G (67.7%)13.89G (67.1%)−6%

The check matters more for dart analyze of one large package with a filled cache, where everything else is cached, and the paths are long and deep. A second dart analyze of the stable_analysis tarball (a separate cache for each build, 7 interleaved rounds, product AOT) went from 7.72G to 6.69G instructions (−13%), and from 673 to 622 ms wall time (−8%). Its profile (non-product AOT, all processes, sampled every 200,000 instructions, which this workload allows without throttling):

BeforeAfterChange
All instructions10.01G9.22G−8%
ContextRootImpl._isExcluded, with callees0.958G (9.6%)0.010G (0.1%)−99%
ContextRootImpl._hasDotNameUnderRoot, with calleesnone0.008G (0.1%)
package:path code, with callees1.375G (13.7%)0.437G (4.7%)−68%

CL 580660: Look up the ancestors of a path in AbstractNotificationManager._isIncluded

_isIncluded checked each file against every included and excluded path with Context.isWithin and Context.equals. Now a new PathSubtreeSet looks up the file and those of its ancestors that have the length of a root in a PathSet of package:path, so the cost no longer depends on the number of excludes.

Warm medians:

Packageslegacy_3p_excludeslsp_3p_excludeslsp_no_excludes
25230 → 208 ms214 → 193 ms174 → 174 ms
50536 → 440 ms511 → 418 ms344 → 352 ms
1001386 → 1008 ms1337 → 950 ms690 → 694 ms

Exclude overhead:

Packageslegacy_3p_excludeslsp_3p_excludes
2556 → 34 ms41 → 18 ms
50192 → 89 ms167 → 67 ms
100696 → 314 ms647 → 257 ms

Profile:

BeforeAfterChange
All server instructions20.71G12.69G−39%
AbstractNotificationManager._isIncluded, with callees8.08G (39.0%)0.061G (0.5%)−99%
PathSubtreeSet.containsSelfOrAncestor, with calleesnone0.056G (0.4%)
ContextRootImpl._isExcluded, with callees5.47G (26.4%)5.55G (43.7%)unchanged
package:path code, with callees13.87G (67.0%)6.00G (47.3%)−57%

After this change, isWithin in ContextRootImpl._isExcluded (41.9%) is most of the remaining exclude overhead.

CL 580800: Look up the ancestors of a path in ContextRootImpl._isExcluded

_isExcluded checked each file against every excluded path with Context.isWithin, both while listing the files of the context root and in isAnalyzed for every analysis result. Now ContextRootImpl keeps the excluded paths in a PathSubtreeSet, which addExcluded updates, so the cost no longer depends on the number of excludes.

Warm medians:

Packageslegacy_3p_excludeslsp_3p_excludeslsp_no_excludes
25206 → 192 ms190 → 174 ms175 → 172 ms
50443 → 380 ms418 → 350 ms348 → 347 ms
100996 → 760 ms948 → 703 ms696 → 694 ms

Exclude overhead:

Packageslegacy_3p_excludeslsp_3p_excludes
2530 → 20 ms15 → 2 ms
5095 → 33 ms70 → 3 ms
100301 → 66 ms252 → 9 ms

Profile:

BeforeAfterChange
All server instructions12.68G6.97G−45%
ContextRootImpl._isExcluded, with callees5.50G (43.4%)0.044G (0.6%)−99%
PathSubtreeSet.containsSelfOrAncestor, with callees0.065G (0.5%)0.090G (1.3%)
package:path code, with callees5.92G (46.7%)0.62G (8.9%)−89%

One of the 3 profiled runs after the change spent 0.56G more in GC than the other two, which adds 0.19G to the mean. The overhead of lsp_3p_excludes is now within the noise. The 66 ms of legacy_3p_excludes at 100 packages that remain do not depend on the excludes, see the next entry.

CL 580820: A control for each protocol

The overhead of legacy_3p_excludes was computed against lsp_no_excludes, so it included costs of the legacy protocol that do not depend on the excludes. Now each scenario with excludes is compared with the scenario without excludes with the same protocol, and the new legacy_no_excludes is the legacy control.

Measured with the server of CL 580800.

Warm medians:

Packageslegacy_3p_excludeslegacy_no_excludeslsp_3p_excludeslsp_no_excludes
25193 ms191 ms176 ms174 ms
50383 ms383 ms353 ms346 ms
100762 ms751 ms706 ms694 ms

Exclude overhead, against lsp_no_excludes → against the control with the same protocol:

Packageslegacy_3p_excludeslsp_3p_excludes
2519 → 2 ms3 ms
5037 → 0 ms7 ms
10069 → 11 ms12 ms

The overhead of both scenarios is within the noise, so with the optimizations above, the IDE excludes cost about 10 ms at 100 packages in either protocol.

The legacy protocol costs more than LSP: legacy_no_excludes minus lsp_no_excludes is 17, 37, and 58 ms at 25, 50, and 100 packages. In a profile of the 3 warm runs of both controls at 100 packages, the legacy server executes 1.34G more instructions (7.04G → 8.38G):

  • 0.57G to send analysis.errors for every file, even without errors, while the LSP server publishes diagnostics only for files that have them. Of these, 0.35G convert the path of the file to a URI in Context.toUri, about half of it in Context.current, which reads Uri.base on every call, even for an absolute path.
  • 0.38G to send analysis.flushResults for every file at shutdown, after the measured time.
  • 0.17G in BulkFixProcessor, which lists the files of every context root for DartFixPromptManager.
  • 0.17G in GC and other threads.

CL 580840: Convert file paths to URIs without Context.toUri in ClientUriConverter

When the client sends supportsUris: true, as IntelliJ does with SDK 3.4 and newer, the legacy server converts the path of every file in analysis.errors and other notifications to a file: URI. Context.toUri did this by reading Context.current, which reads Uri.base on every call, splitting the path into segments, building a Uri, and converting it back to a string. Now toClientFilePath writes file:// and the path, with the characters that are not allowed in a URI path percent-encoded. Windows UNC paths still use Context.toUri.

Measured with 4 interleaved rounds.

Warm medians:

Packageslegacy_3p_excludeslegacy_no_excludeslsp_3p_excludeslsp_no_excludes
25190 → 186 ms192 → 184 ms176 → 176 ms174 → 174 ms
50377 → 369 ms376 → 368 ms354 → 354 ms348 → 349 ms
100755 → 741 ms749 → 737 ms704 → 707 ms695 → 694 ms

The cost of the legacy protocol, legacy_no_excludes minus lsp_no_excludes:

PackagesBeforeAfter
2517 ms10 ms
5029 ms19 ms
10055 ms43 ms

Profile of the 3 warm runs of legacy_no_excludes at 100 packages:

BeforeAfterChange
All server instructions8.37G7.75G−7%
ClientUriConverter.toClientFilePath, with callees0.66G (7.9%)0.038G (0.5%)−94%
AnalysisServer.handleAnalysisEvent, with callees0.69G (8.2%)0.37G (4.8%)−46%

About half of the conversions are in analysis.flushResults at shutdown, after the measured time.

Limitations

  • It covers excludes sent by the IDE, not analyzer: exclude: globs in analysis_options.yaml, which go through ContextRootImpl.excludedGlobs.
  • It uses one included root, because many separately watched roots on macOS occasionally add 1,000 ms retries (TimerUtils::Sleep(1000) in runtime/bin/file_system_watcher_macos.cc). Real IntelliJ workspaces often send many included roots, and in _isIncluded each included root costs about as much as an excluded one, so this underestimates them.
  • The excluded folders do not exist on disk; the server still records and checks them, but skips no files while listing.
  • In a profile of the warm runs, Packages.packageForPath gets no samples, while _PhysicalFolder.contains, mostly reached from it, is about 5% in the Dart SDK calibration, so this benchmark does not show that cost.

dart analyze of packages of this repository

single_benchmarks/dart_analyze_packages.dart

out/ReleaseX64/dart-sdk/bin/dart \
  pkg/analysis_server/tool/benchmark_tools/single_benchmarks/dart_analyze_packages.dart

It accepts only --dart=<path>, --baseline-dart=<path>, and --json; the scenarios are fixed in code, so every run produces the same comparable report. It takes about 1 minute, or about 4 minutes with --baseline-dart.

What it simulates

Running dart analyze in this repository, with the sources as they are in pkg/, both cold (with an empty analysis cache) and warm (with a filled one):

  • analyzer: pkg/analyzer, one large package.
  • several_packages: 7 related packages, analyzer, analysis_server, and the smaller packages around them.

Each scenario runs one cold dart analyze process with a new cache (--cache) in a temp directory under .dart_tool of the repository, then 5 warm ones with the filled cache. The measured time is the whole process, including launch, because this is what the user waits for. The benchmark does not use the cache in the home directory. It does not use the temp directory of the system either, because that can be in memory: on one Linux machine, with the caches in /tmp (tmpfs), cold analyzer took about 1 s (7%) less, and a server with EvictingFileByteStore looked 4% to 6% slower cold than one with SingleFileByteStore, while on ext4 there was no difference. It fails if the cold run did not write the cache, because the server then uses a cache in memory, and every warm run would be cold.

Who is affected

  • Cold: CI jobs without a kept cache, a new checkout, the first run after an update of the SDK that invalidates the cache. Almost all of the time is linking, resolution, and diagnostics.
  • Warm: people and scripts (Git hooks, presubmit checks) that run dart analyze repeatedly with a kept cache. IDE startup reads the same cache, so it shares most of this work.

Metrics

For each scenario, separately for cold and warm:

  • Primary: time, mean of the runs.
  • Instructions (user space, all processes, mean of the runs), counted with perf stat, only on Linux.
  • Peak memory: the peak resident memory of the largest process, which is the analysis server, mean of the runs, from /usr/bin/time, only on Linux. It is what a machine or container must have, not what stays live after a garbage collection.

The report also prints the commit of the sources, and for each scenario the number of Dart files and lines, the number of reported issues, and the number of nested package_config.json files. Each nested config creates an analysis context, and they are not all in the repository: pkg/analyzer/tool/{ast,element,generators} have their own only after dart pub get, and use a published analyzer. With out-of-date configs that gave analyzer_utilities different language versions, the warm time of pkg/analyzer was 42 ms (2.6%) higher than after dart pub upgrade, because the contexts replaced the linked bundles of each other in the cache.

How to compare

The sources change with almost every commit, and they are also what is analyzed: in the 30 days before 2026-11-23 the 7 packages grew by 2.2% in lines, and analyzing the older sources with the same SDK took 1.0% less warm time and 1.8% fewer instructions. So:

  • Run the benchmark with --dart of the SDK with the change, and --baseline-dart of the SDK without it, both built in the same way. Each is the dart executable in a whole SDK directory, because dart analyze runs the analysis server of its SDK. Both analyze the same sources, and the lib of the SDK of --dart (--sdk-path), so differences in lib and in the lengths of SDK paths are not measured; do not edit the sources while it runs.
  • For each scenario it runs cold in the order baseline, change, change, baseline, each with a new cache, and then warm 5 times in the same order, each SDK with its last cache. This gives 2 cold and 10 warm runs of each SDK. Four separately built caches gave the same mean warm time, so one cache for each SDK is enough.
  • For warm it prints the means, and the change with its approximate 95% range (Student's t, with the same variance of both SDKs). A range that includes 0 means that no change was shown. It assumes independent runs, but neighboring runs are slightly similar (correlation 0.24 of the times), and other differences between invocations are not included. One of 20 ranges does not include the true change even without a problem, so in a table of 6 warm cells one wrong cell is not unusual. Comparing an SDK to itself in 3 invocations gave warm time ranges that include 0 in all 6 cells. Instructions differ more between invocations than between runs, so their ranges are too narrow: for warm several_packages one invocation gave +0.5% ± 0.4. Changes of that size are not shown, whatever their ranges.
  • For cold it prints both runs of each SDK, without a range, because 2 runs say too little about their spread. To see a small change of cold, run the benchmark several times.
  • For peak memory it prints the means (cold: the runs), without a change. Its differences between invocations are larger than its range: comparing an SDK to itself gave warm several_packages from −1.2% to +1.2%, with ranges that did not include 0, and cold from −4.3% to +3.4%.
  • Cold peak memory varies much more than warm. In 32 cold runs of several_packages with the same SDK, peak memory was from 2352 to 2530 MiB, in many runs near 2360 or near 2500, and both can follow each other. The cause is not known.
  • Do not compare the results of different commits or machines.

Baseline

Linux x64, AMD Ryzen 9 PRO 8945HS, 2026-11-30, product AOT server compiled from c26e1d38c52 (VM and lib from 3662148bfa6), sources from c26e1d38c52 with this benchmark, caches on ext4, the baseline of one invocation (cold: mean of 2 runs, warm: mean of 10 runs).

ScenarioFilesLinesNested configsIssues
analyzer16241,567,95130
several_packages44032,473,28640
ScenarioModeTimeInstructionsPeak memory
analyzercold16761 ms163.21G1441 MiB
analyzerwarm1676 ms16.78G498 MiB
several_packagescold27671 ms261.80G2548 MiB
several_packageswarm2532 ms25.59G668 MiB

Optimizations

Each entry is measured against its parent commit, with the same sources, on the machine of the baseline above (product AOT, --baseline-dart). Profiles are of all processes, from launch to exit, all threads, in 3 warm runs of analyzer (product AOT, perf record -e instructions:u -c 1000000 -g, mean of the 3 runs). A row “with callees” counts every sample that has that code anywhere on its stack.

CL 581142: Always read xxh64 words through a typed data view

SingleFileByteStore verifies the xxh64 checksum of every value that it reads. The words were read through two list types, so AOT did not inline the reads. Now they are always read through a typed data view.

ScenarioModeTimeInstructionsPeak memory
analyzercold16809, 16713 → 16392, 16660 ms (−1.4%)163.11, 163.31 → 160.49, 161.46 G (−1.4%)1435, 1447 → 1523, 1431 MiB
analyzerwarm1676 → 1567 ms (−6.5% ± 0.9)16.78 → 16.03 G (−4.4% ± 0.4)498 → 496 MiB
several_packagescold27807, 27535 → 27273, 27482 ms (−1.1%)261.94, 261.65 → 260.98, 260.91 G (−0.3%)2559, 2536 → 2495, 2499 MiB
several_packageswarm2532 → 2363 ms (−6.7% ± 0.9)25.59 → 24.36 G (−4.8% ± 0.6)668 → 654 MiB

Warm profile:

BeforeAfterChange
All instructions16.72G15.98G−4.4%
xxh64, with callees1.29G (7.7%)0.44G (2.7%)−66%
SingleFileByteStore.get, with callees2.40G (14.3%)1.57G (9.8%)−35%

The time improves more than the instructions, probably because the removed ones were slow: the reads were calls, and allocated objects for values that do not fit into a Smi.

Limitations

  • It measures peak memory, not how much memory the analysis server retains, which is what matters in an IDE. dart analyze uses the product AOT runtime, which has no VM service, so it cannot run a full garbage collection and report the live heap.
  • Cold has only 2 runs of each SDK with a baseline, and one without, so it shows only large changes of time, and even larger ones of peak memory.
  • Instructions and peak memory are measured only on Linux.
  • Peak memory is of one process, so it does not include the dart process that starts the server.
  • It analyzes this repository, which has much generated and test code, and no errors. Code with many diagnostics spends more on them.
  • The number of nested configs, so also the time, depends on the checkout.