)]}'
{
  "commit": "e138a251cdd8373a5fed484818280f1cfa5fe2e2",
  "tree": "2c81a45ad9b305cdd5f03bf44cca3953446c5598",
  "parents": [
    "2ddc3d5970d4f5fd1600b8dce6d5dcdf107a8ca6"
  ],
  "author": {
    "name": "Felipe Peter",
    "email": "mr-peipei@web.de",
    "time": "Tue May 05 10:07:35 2026 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue May 05 17:07:35 2026 +0000"
  },
  "message": "Cache plugin registrant in test compiler (#185598)\n\nTowards #69429 (\"Make `flutter test` faster\"). \n\nThis change makes `TestCompiler` cache the plugin registrant instead\nof regenerating it for each test file. Plugins are stable for the\nlifetime of a single `flutter test`\nrun. However, the Dart version of test files might differ, so the cache\nis keyed on the test file\u0027s\nDart version. \n\n**Benchmark**\nFlutter foundation test suite (32 files, 220 tests), `flutter test -j\n4`, 3 runs + 1 warmup:\n\n|                                 | master | this PR    |\n| ------------------------------- | ------ | ---------- |\n| Avg compile per subsequent file | 68ms   | 55ms   |\n\nThat means the startup time for `flutter test` is reduced by ~13ms _per\ntest file_ on my machine. That quickly adds up and significantly\nimproves Flutter\u0027s TDD experience.\n\nResults were generated with the following script:\n\n\u003cdetails\u003e\u003csummary markdown\u003d\"span\"\u003eBenchmark\u003c/summary\u003e\n\n```bash\n#!/usr/bin/env bash\n# Reports per-run, for foundation suite, -j 4:\n#   - wall      : total `flutter test` invocation time\n#   - first     : compile time for the first test file (cache miss)\n#   - subseq    : average compile time per subsequent file (cache hit / miss)\n#   - total     : sum of all per-file compile times\n#\n# The \"subseq\" and \"total\" rows are the ones the PR moves; \"wall\" is dominated\n# by test execution and is reported for completeness.\n\nset -euo pipefail\n\nFLUTTER_ROOT\u003d\"${FLUTTER_ROOT:-$(pwd)}\"\nFLUTTER\u003d\"$FLUTTER_ROOT/bin/flutter\"\nTARGET\u003d\"$FLUTTER_ROOT/packages/flutter/test/foundation/\"\nRUNS\u003d\"${RUNS:-3}\"\n\ncd \"$FLUTTER_ROOT/packages/flutter\"\n\nbench_one() {\n  local name\u003d\"$1\" log\n  log\u003d$(mktemp)\n  local start end ms\n  start\u003d$(date +%s%N)\n  \"$FLUTTER\" test -j 4 -v \"$TARGET\" \u003e\"$log\" 2\u003e\u00261\n  end\u003d$(date +%s%N)\n  ms\u003d$(( (end - start) / 1000000 ))\n\n  local compiles n first sum rest_avg\n  compiles\u003d$(grep -oP \u0027Compiling .+ took \\K\\d+(?\u003dms)\u0027 \"$log\" || true)\n  n\u003d$(echo \"$compiles\" | grep -c . || true)\n  first\u003d$(echo \"$compiles\" | head -1)\n  sum\u003d$(echo \"$compiles\" | awk \u0027{s+\u003d$1} END{print s+0}\u0027)\n  rest_avg\u003d0\n  if [[ \"$n\" -gt 1 ]]; then\n    rest_avg\u003d$(echo \"$compiles\" | tail -n +2 | awk \u0027{s+\u003d$1} END{print int(s/NR)}\u0027)\n  fi\n  printf \"  %-8s wall\u003d%5dms  first\u003d%4dms  subseq\u003d%3dms (n\u003d%d)  total\u003d%5dms\\n\" \\\n    \"$name\" \"$ms\" \"$first\" \"$rest_avg\" \"$((n-1))\" \"$sum\"\n  rm -f \"$log\"\n}\n\necho \"Foundation suite (32 files, ~220 tests), -j 4, $RUNS runs + 1 warmup\"\necho \"Commit: $(cd \"$FLUTTER_ROOT\" \u0026\u0026 git rev-parse --short HEAD) ($(cd \"$FLUTTER_ROOT\" \u0026\u0026 git status --porcelain | wc -l) modified files)\"\nbench_one \"warmup\"\nfor i in $(seq 1 \"$RUNS\"); do\n  bench_one \"run_$i\"\ndone\n```\n\n\u003c/details\u003e \n\n## Pre-launch Checklist\n\n- [x] I read the [Contributor Guide] and followed the process outlined\nthere for submitting PRs.\n- [x] I read the [AI contribution guidelines] and understand my\nresponsibilities, or I am not using AI tools.\n- [x] I read the [Tree Hygiene] wiki page, which explains my\nresponsibilities.\n- [x] I read and followed the [Flutter Style Guide], including [Features\nwe expect every widget to implement].\n- [x] I signed the [CLA].\n- [x] I listed at least one issue that this PR fixes in the description\nabove.\n- [x] I updated/added relevant documentation (doc comments with `///`).\n- [x] I added new tests to check the change I am making, or this PR is\n[test-exempt].\n- [x] I followed the [breaking change policy] and added [Data Driven\nFixes] where supported.\n- [ ] All existing and new tests are passing.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "8d11ff1f55ae3619e6cb289b625ad52e9cf32312",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/lib/src/test/test_compiler.dart",
      "new_id": "c51a6a03332942cec8e640a4d7b5fa21f9332fbc",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/lib/src/test/test_compiler.dart"
    },
    {
      "type": "modify",
      "old_id": "8bb21ea08642621ffdfd5549cf9c9269d84ec953",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/test/general.shard/test/test_compiler_test.dart",
      "new_id": "b9a32553050e7828d7af18d2a2ebddc819cccb51",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/test/general.shard/test/test_compiler_test.dart"
    }
  ]
}
