)]}'
{
  "commit": "e352e8b044ebfe2a0ed31be43f6d57cf1a041a7e",
  "tree": "2c246bc8c0c620a3e3dbdcbd0cf22552843ede60",
  "parents": [
    "573e600deab699a49659bb80c2f3c3d53bc1b3be"
  ],
  "author": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Thu Apr 24 13:36:26 2025 -0400"
  },
  "committer": {
    "name": "Simon Marchi",
    "email": "simon.marchi@efficios.com",
    "time": "Tue Apr 29 15:30:39 2025 -0400"
  },
  "message": "gdb/dwarf: scan DWARF 5 DWO CUs by just reading the header\n\ncreate_dwo_cus_hash_table is implemented by creating a cutu_reader\n(which is somewhat heavy) for all units in a .dwo file.  The purpose of\nthis cutu_reader is to be able to get the DWO ID, if it is specified by\na DW_AT_GNU_dwo_id attribute.\n\nIn DWARF 5, however, the DWO ID is available in the CU header.  We can\naccess it without accessing the DIEs, by just reading the header, which\nis more lightweight.  Add a new code path to create_dwo_cus_hash_table\nthat does that.  The logic is copied from\ncreate_dwo_debug_type_hash_table, which does this already.\n\nThis change helps circumvent a performance problem I want to fix (the\nsame I was trying to fix in this patch [1]) when loading a file built\nwith -gdwarf-5, -gsplit-dwarf and -fdebug-types-section.  In this\nconfiguration, the produced .dwo files contain one compile unit and many\ntype units each.  All units in a given .dwo share the same abbrev table.\nCreating a cutu_reader for each unit meant re-reading the same abbrev\ntable over and over.  What\u0027s particularly bad is that this is done with\nthe dwo_lock held, preventing other indexing threads from making\nprogress.\n\nTo give a rough idea, here\u0027s the time take by each worker to index units\nbefore this patch (on a rather large program):\n\n    Time for \"DWARF indexing worker\": wall 18.627, user 0.885, sys 0.042, user+sys 0.927, 5.0 % CPU\n    Time for \"DWARF indexing worker\": wall 18.888, user 0.862, sys 0.042, user+sys 0.904, 4.8 % CPU\n    Time for \"DWARF indexing worker\": wall 19.172, user 1.848, sys 0.069, user+sys 1.917, 10.0 % CPU\n    Time for \"DWARF indexing worker\": wall 19.297, user 1.544, sys 0.051, user+sys 1.595, 8.3 % CPU\n    Time for \"DWARF indexing worker\": wall 19.545, user 3.408, sys 0.084, user+sys 3.492, 17.9 % CPU\n    Time for \"DWARF indexing worker\": wall 19.759, user 4.221, sys 0.117, user+sys 4.338, 22.0 % CPU\n    Time for \"DWARF indexing worker\": wall 19.789, user 4.187, sys 0.105, user+sys 4.292, 21.7 % CPU\n    Time for \"DWARF indexing worker\": wall 19.825, user 4.933, sys 0.135, user+sys 5.068, 25.6 % CPU\n\nAnd the times with this patch:\n\n    Time for \"DWARF indexing worker\": wall 0.163, user 0.089, sys 0.029, user+sys 0.118, 72.4 % CPU\n    Time for \"DWARF indexing worker\": wall 0.176, user 0.096, sys 0.041, user+sys 0.137, 77.8 % CPU\n    Time for \"DWARF indexing worker\": wall 0.265, user 0.167, sys 0.054, user+sys 0.221, 83.4 % CPU\n    Time for \"DWARF indexing worker\": wall 0.353, user 0.257, sys 0.060, user+sys 0.317, 89.8 % CPU\n    Time for \"DWARF indexing worker\": wall 0.524, user 0.399, sys 0.088, user+sys 0.487, 92.9 % CPU\n    Time for \"DWARF indexing worker\": wall 0.648, user 0.517, sys 0.107, user+sys 0.624, 96.3 % CPU\n    Time for \"DWARF indexing worker\": wall 0.657, user 0.523, sys 0.107, user+sys 0.630, 95.9 % CPU\n    Time for \"DWARF indexing worker\": wall 0.753, user 0.612, sys 0.120, user+sys 0.732, 97.2 % CPU\n\n[1] https://inbox.sourceware.org/gdb-patches/20250326200002.136200-8-simon.marchi@efficios.com/\n\nChange-Id: I34a422577e4c3ad7d478ec6df12a0e44d284c249\nApproved-By: Tom Tromey \u003ctom@tromey.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "281cf118eb8d5499c9356014a7176b1a18647cfa",
      "old_mode": 33188,
      "old_path": "gdb/dwarf2/read.c",
      "new_id": "9a5e3b10a2c2545a395f7e6c454724d39beabb80",
      "new_mode": 33188,
      "new_path": "gdb/dwarf2/read.c"
    }
  ]
}
