From patchwork Thu Jun 29 05:16:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luc Van Oostenryck X-Patchwork-Id: 9815947 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3415F60365 for ; Thu, 29 Jun 2017 05:19:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CCA6280DE for ; Thu, 29 Jun 2017 05:19:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D2A42847B; Thu, 29 Jun 2017 05:19:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A589C285E0 for ; Thu, 29 Jun 2017 05:19:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751656AbdF2FTB (ORCPT ); Thu, 29 Jun 2017 01:19:01 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33112 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751637AbdF2FTA (ORCPT ); Thu, 29 Jun 2017 01:19:00 -0400 Received: by mail-wm0-f67.google.com with SMTP id j85so351609wmj.0 for ; Wed, 28 Jun 2017 22:19:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=LR5k5K1p6INICUunhMDdtPnHxFY08aNkmewKbpVA1bA=; b=Yk5IMXhMZxcAVPIck+BrDgSoq95ddAFjqqXKUDrflTwLzzPtvt0GbT6boyDGzMRoQ9 ZX5V1UVoZvqxpkgPQB+Ps1AcFdchJRxNQafVJ8CRHRm7FXsbohcHm7kSoZmbnffIHXv0 7i7p/7R5KqFApjTNLqDBPe/PSikoAhB3AqhfE19jpgFY23VuvlzJ9Un0GHKta4sGoZ1n zSFWePihbwdQeHDfhDICkOhS01dlKNKv0jzLQl0m+u7+MAlm61/lmEIbN5dgTTe+3Prh +W1eh96dLAvKuvk/fI098Z5LX/4PdNxQ48/8CWUbDK1twWZ85nvJFbDhz7dkYbtGbKW7 r4Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LR5k5K1p6INICUunhMDdtPnHxFY08aNkmewKbpVA1bA=; b=t4iARvL640a4j4w1/AOBl68NxgSUFv3vENZVAAn71FLAMxnJYUyF7UyFzSTrUwcXly 4xwPWLHvGuXAed+mDcFU3faWekMTl5b1w9GVGaDd0yCZVnUrFUDvhtPZUm0cE5xfaaL7 1CAAZuSR18cn4ff81uqq1eaRwf5N1kLLIvyNPLldYJJv2u16Piut2wpLmnZ7lavE8NX3 t5HPfCynF6vp16scokO3vmc5iW3LSA8fd4yQTjO9ThIYCqU04hiKGDH6P24t0kF6gvVb NaSvzr+Gljty75B71tsOu0vRweAu7KD6knGFcZlLxB2/sTj4R8DPc9aB6SERVTRMc9rv eNGw== X-Gm-Message-State: AKS2vOw7ZejGUCR4Vka233njGEbzaT1z9XuEHD29xguq/tXF+ACPPLgI hZs4Sx26UGrTfG5G++k= X-Received: by 10.80.152.194 with SMTP id j60mr306998edb.98.1498713539252; Wed, 28 Jun 2017 22:18:59 -0700 (PDT) Received: from localhost.localdomain ([2a02:a03f:837:f300:1816:df24:7b15:fb23]) by smtp.gmail.com with ESMTPSA id z58sm132566edb.50.2017.06.28.22.18.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jun 2017 22:18:58 -0700 (PDT) From: Luc Van Oostenryck To: linux-sparse@vger.kernel.org Cc: Christopher Li , Luc Van Oostenryck Subject: [PATCH 2/7] diet: use smaller LIST_NODE_NR (29 -> 13) Date: Thu, 29 Jun 2017 07:16:41 +0200 Message-Id: <20170629051646.35988-3-luc.vanoostenryck@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170629051646.35988-1-luc.vanoostenryck@gmail.com> References: <20170629051646.35988-1-luc.vanoostenryck@gmail.com> Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently the size of the array used for ptrlist is 29. However, some inspection shows that the mean size of ptrlists is much smaller: around 2.5 - 5 only. This means that most memory allocated for ptrlists are never used. Change this by changing the size to the conservative value of 13. With this value, on some test programs, memory used for ptrlists is only 43% - 48% smaller or 24% - 28% for the total memory. This difference in memory consumption allow also to win some time: 5 - 7% in the conditions used for the test but YMMV. Signed-off-by: Luc Van Oostenryck --- ptrlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ptrlist.h b/ptrlist.h index d09be2f51..b605bb858 100644 --- a/ptrlist.h +++ b/ptrlist.h @@ -22,7 +22,7 @@ */ #define MKTYPE(head,expr) ({ (TYPEOF(head))(expr); }) -#define LIST_NODE_NR (29) +#define LIST_NODE_NR (13) struct ptr_list { int nr;