)]}'
{
  "commit": "20a26f4e018cd0cb40a3b81568be0d4f164eed0f",
  "tree": "28ffe28aa1e3eef2791afa1ff7c2fb368091661e",
  "parents": [
    "f420c9c84eb53fea7da452eab8ae0bd855537859"
  ],
  "author": {
    "name": "Tom Tromey",
    "email": "tromey@adacore.com",
    "time": "Fri May 13 13:46:52 2022 -0600"
  },
  "committer": {
    "name": "Tom Tromey",
    "email": "tromey@adacore.com",
    "time": "Thu May 26 07:35:30 2022 -0600"
  },
  "message": "Finalize each cooked index separately\n\nAfter DWARF has been scanned, the cooked index code does a\n\"finalization\" step in a worker thread.  This step combines all the\nindex entries into a single master list, canonicalizes C++ names, and\nsplits Ada names to synthesize package names.\n\nWhile this step is run in the background, gdb will wait for the\nresults in some situations, and it turns out that this step can be\nslow.  This is PR symtab/29105.\n\nThis can be sped up by parallelizing, at a small memory cost.  Now\neach index is finalized on its own, in a worker thread.  The cost\ncomes from name canonicalization: if a given non-canonical name is\nreferred to by multiple indices, there will be N canonical copies (one\nper index) rather than just one.\n\nThis requires changing the users of the index to iterate over multiple\nresults.  However, this is easily done by introducing a new \"chained\nrange\" class.\n\nWhen run on gdb itself, the memory cost seems rather low -- on my\ncurrent machine, \"maint space 1\" reports no change due to the patch.\n\nFor performance testing, using \"maint time 1\" and \"file\" will not show\ncorrect results.  That approach measures \"time to next prompt\", but\nbecause the patch only affects background work, this shouldn\u0027t (and\ndoesn\u0027t) change.  Instead, a simple way to make gdb wait for the\nresults is to set a breakpoint.\n\nBefore:\n\n    $ /bin/time -f%e ~/gdb/install/bin/gdb -nx -q -batch \\\n        -ex \u0027break main\u0027 /tmp/gdb\n    Breakpoint 1 at 0x43ec30: file ../../binutils-gdb/gdb/gdb.c, line 28.\n    2.00\n\nAfter:\n\n    $ /bin/time -f%e ./gdb/gdb -nx -q -batch \\\n        -ex \u0027break main\u0027 /tmp/gdb\n    Breakpoint 1 at 0x43ec30: file ../../binutils-gdb/gdb/gdb.c, line 28.\n    0.65\n\nRegression tested on x86-64 Fedora 34.\n\nBug: https://sourceware.org/bugzilla/show_bug.cgi?id\u003d29105\n\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d8a1ab8d30e49830967249e3a804bbb51708bffc",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/cooked-index.c",
      "new_id": "3e34ad0e501ff4f9ff2781881a8ea91d3dc8fd1e",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/cooked-index.c"
    },
    {
      "type": "modify",
      "old_id": "ad4de05ba52cccc49cbbe13016c28868a7348f79",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/cooked-index.h",
      "new_id": "4e65e9d0c61c077aeda85453b039ec4134e9771a",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/cooked-index.h"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "57427370341a25cd8cfafcbb3e1318ac9a6ce757",
      "new_mode": 33188,
      "new_path": "gdbsupport/range-chain.h"
    }
  ]
}
