From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6729 invoked by alias); 10 Jan 2014 03:32:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 6698 invoked by uid 89); 10 Jan 2014 03:32:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.5 required=5.0 tests=AWL,BAYES_00,GARBLED_BODY autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Jan 2014 03:32:32 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1W1Spg-0006Vg-Ot from Yao_Qi@mentor.com ; Thu, 09 Jan 2014 19:32:28 -0800 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 9 Jan 2014 19:32:28 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Thu, 9 Jan 2014 19:31:07 -0800 Message-ID: <52CF6966.1060405@codesourcery.com> Date: Fri, 10 Jan 2014 03:32:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Tom Tromey CC: Subject: Re: [PATCH] rearrange struct value to save memory References: <1389294182-982-1-git-send-email-tromey@redhat.com> In-Reply-To: <1389294182-982-1-git-send-email-tromey@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2014-01/txt/msg00268.txt.bz2 On 01/10/2014 03:03 AM, Tom Tromey wrote: > This patch rearranges struct value a tiny bit, moving the "regnum" > field into a hole. This saves 8 bytes per value on a 64-bit machine, > and 4 bytes per value on a 32 bit machine. I think it does not > negatively affect readability or performance. > > Built and regtested on x86-64 Fedora 18. > > Let me know what you think. > Hi, Tom, It does save some memory shown by the result of 'make perf-check' on an amd64-linux box. I don't see any time performance regression in the test. It is indeed a good improvement! Original Patched backtrace vmsize 2 55108 54316 backtrace vmsize 4 55108 52432 backtrace vmsize 8 53124 51512 backtrace vmsize 16 53124 51512 backtrace vmsize 32 53124 51512 backtrace vmsize 64 53124 51512 backtrace vmsize 128 53124 51512 backtrace vmsize 256 53124 51512 backtrace vmsize 512 53124 51512 backtrace vmsize 1024 53124 51512 backtrace vmsize 2048 53124 51512 disassemble vmsize 0 66740 66732 disassemble vmsize 1 66740 66732 disassemble vmsize 2 66740 66732 single-step vmsize 10000 50388 50384 single-step vmsize 20000 50652 50648 single-step vmsize 30000 51048 51044 single-step vmsize 40000 51312 51308 skip-prologue vmsize 1 50104 50100 skip-prologue vmsize 2 50104 50100 skip-prologue vmsize 3 50104 50100 solib_load vmsize 8 64968 64960 solib_load vmsize 16 64968 64960 solib_load vmsize 32 64968 64960 solib_load vmsize 64 64968 64960 solib_load vmsize 128 64968 64960 solib_unload vmsize 8 64972 64964 solib_unload vmsize 16 64972 64964 solib_unload vmsize 32 64972 64964 solib_unload vmsize 64 64972 64964 solib_unload vmsize 128 64972 64964 -- Yao (齐尧)