From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kSiQA26vgGCWRgAAWB0awg (envelope-from ) for ; Wed, 21 Apr 2021 19:04:14 -0400 Received: by simark.ca (Postfix, from userid 112) id F400E1F104; Wed, 21 Apr 2021 19:04:13 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=DKIM_SIGNED,MAILING_LIST_MULTI, RCVD_IN_BL_SPAMCOP_NET,T_DKIM_INVALID,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 068101E789 for ; Wed, 21 Apr 2021 19:04:13 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B97CC3987C0D; Wed, 21 Apr 2021 23:04:12 +0000 (GMT) Received: from gateway31.websitewelcome.com (gateway31.websitewelcome.com [192.185.143.36]) by sourceware.org (Postfix) with ESMTPS id D4B77389366E for ; Wed, 21 Apr 2021 23:04:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org D4B77389366E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=tom@tromey.com Received: from cm14.websitewelcome.com (cm14.websitewelcome.com [100.42.49.7]) by gateway31.websitewelcome.com (Postfix) with ESMTP id 3945A23DEA for ; Wed, 21 Apr 2021 18:04:08 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id ZLtAlf3qlw11MZLtAl7ydj; Wed, 21 Apr 2021 18:04:08 -0500 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=5em2Mx1+pnYDXm2qsHhd9TZ44bQaLWEfSKMz19NMcgY=; b=E12glHCpu/CDnlpeDlB/7oL1J7 rU1GI1tu7yu+jPVAfA8xsd0QsOul5Vd65BqEgMhX+qRl1mmYvctUDqgcXeM2ygZ9CiXH4GKkpYhhg JKV4lcZfYfzjFnDshYzcKZDV+; Received: from 71-211-182-15.hlrn.qwest.net ([71.211.182.15]:37610 helo=localhost.localdomain) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1lZLt9-001K0k-Th; Wed, 21 Apr 2021 17:04:07 -0600 From: Tom Tromey To: Gary Benson Subject: Re: [PATCH] Shrink size of dwarf2_per_cu_data References: <20201103221306.6688-1-tom@tromey.com> <20201104105933.GA16965@blade.nx> X-Attribution: Tom Date: Wed, 21 Apr 2021 17:04:07 -0600 In-Reply-To: <20201104105933.GA16965@blade.nx> (Gary Benson's message of "Wed, 4 Nov 2020 10:59:33 +0000") Message-ID: <871rb3gryw.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.182.15 X-Source-L: No X-Exim-ID: 1lZLt9-001K0k-Th X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-182-15.hlrn.qwest.net (localhost.localdomain) [71.211.182.15]:37610 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Tromey , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" >>>>> "Gary" == Gary Benson writes: Gary> Tom Tromey wrote: >> I noticed some holes in struct dwarf2_per_cu_data. This patch >> rearranges the type slightly, and shrinks the size of some fields. >> This reduces it from 136 bytes to 112 bytes (on x86-64). Gary> Nice. Though I'd assumed the compiler would do this. C and C++ compilers can't generally do this, though other languages like Rust and Ada do allow it. >> I also reduced the size of the DWARF "version" fields in a couple of >> spots. It seemed needless to use a short to hold a value that >> ranges from 2 to 5, and this also helped the goal of shrinking >> dwarf2_per_cu_data. Gary> There's other things in there if you were going that way, e.g.: Gary> unsigned char addr_size; Gary> unsigned char signed_addr_p; Gary> sect_offset abbrev_sect_off; Gary> /* Size of file offsets; either 4 or 8. */ Gary> unsigned int offset_size; Gary> /* Size of the length field; either 4 or 12. */ Gary> unsigned int initial_length_size; Gary> I presume you'd need to lose 8 whole bytes to shrink the struct Gary> further, so marking these as <8bit values probably wouldn't help Gary> any, but maybe it's worth it? I looked at this, and it doesn't remove enough space to help. Might still be worth doing for clarity, I dunno. Gary> How many CUs does something big Gary> have? gdb has 1197 as of today, but IMO it is moderately-sized at best. I don't have anything really big that's convenient to check. Tom