From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x130.google.com (mail-il1-x130.google.com [IPv6:2607:f8b0:4864:20::130]) by sourceware.org (Postfix) with ESMTPS id 9551C385B537 for ; Fri, 10 Feb 2023 14:21:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9551C385B537 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-il1-x130.google.com with SMTP id u8so2195116ilq.13 for ; Fri, 10 Feb 2023 06:21:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/Mf2ftF5IXUkfDQxQQP5vOEUtOA46jz/RTCiPdcB91Q=; b=PewF4NuJURMGuIywcuq89r8okRoRmIv/QqkMTacTMGVb5qHfwdhGuMp/IddnFFfIu6 sNAbX3PFzNMqu+E2GkNa9TMO3VR6PTLwgAWsozsc0r0FP14abk/wR0w50Om8QN5ec1I4 EEpjYyIn+Kw90CslW0kXTNeHyikN9kZRP5+THOItfbohXOY0Ll5V0iys8/TnZD6b5WHu fyMNOcPQTjCyu8CNtKDy+67OO8a1Hrn2nGuZOdS/IltHSq0dxnd0wndvDPV4c8VdtZhB 7O40teP/CYBAJhnXQ1iEvKOO8b0dbGJ7v3WHNTurwJc2Bxw9uVB6F0g/qckq20N+nAZn fprw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/Mf2ftF5IXUkfDQxQQP5vOEUtOA46jz/RTCiPdcB91Q=; b=q6e80v4F0q9mrogmbkBSyGx7x7sJeusRQaNhhAiOMPMcyvzHGfAKsFdmYBK/qFJscL sBYaA4EYoHTpvYHoimfYiK14Dy0vG17mD8Digim57oXLgVg3YN3nc0Qz4IdGsiW6ZL78 CbGTzXAql3CXzWLqXsDLyXtiXM/Eky+VcZ+rRv3Qc7L7bx+yDyKn8pdnwv2FLYX2JgFQ KK7A0jtAe25TlUJGtQ31usTsy6SgAaQedmOeBZyKzvB+jqgpD6cIOhlfA27tifIExloM c/fKHiHja7g6jknawTxH/7sb3O4oa1+kTMebKx7pfbMBCxAjqqrfLGRIUheC0SVy7YhH wFDQ== X-Gm-Message-State: AO0yUKVpZ5D8yu2NDjK+o9HsT6t+/n8VTLNm0Ffo4uig2FlhNiuxBjd/ 9id0C3KZaH6oJJd8oxPCmHsyyJ+/viJCEPGt X-Google-Smtp-Source: AK7set+adswIyxXnOhvZDYs0NgeXzE/3INHZP0mNuK0Nr9s759xPIr6bC+K2LcQwuo8OjnrTi+W0TA== X-Received: by 2002:a05:6e02:216c:b0:313:e73b:d3dd with SMTP id s12-20020a056e02216c00b00313e73bd3ddmr9298672ilv.13.1676038902833; Fri, 10 Feb 2023 06:21:42 -0800 (PST) Received: from localhost.localdomain (75-166-130-93.hlrn.qwest.net. [75.166.130.93]) by smtp.gmail.com with ESMTPSA id t1-20020a92cc41000000b0031418401f88sm520206ilq.69.2023.02.10.06.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 06:21:42 -0800 (PST) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFC] Populate seen_names hash in cooked_index_shard::do_finalize Date: Fri, 10 Feb 2023 07:21:32 -0700 Message-Id: <20230210142132.2039087-1-tromey@adacore.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hannes pointed out that cooked_index_shard::do_finalize never populates the seen_names hash table. This patch adds the necessary store. This reduces memory use a little for "gdb gdb": (before) Space used: 28909568 (+0 for this command) (after) Space used: 28884992 (+0 for this command) ... about 24k. So maybe it's better to just remove this hash? What this means, btw, is that in gdb there are not many symbols that are both mentioned in many CUs and that also require name canonicalization. It's possible this would differ in other programs. --- gdb/dwarf2/cooked-index.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index 3d23a65ad8f..71852237f98 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -356,6 +356,7 @@ cooked_index_shard::do_finalize () entry->canonical = canon_name.get (); m_names.push_back (std::move (canon_name)); } + *slot = entry; } else { -- 2.39.1