From 491294502da85563e149c4608f386501a8084cbf Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 17 Feb 2013 07:37:37 +2000 Subject: [PATCH] Re: [PATCH] bitmap:improve memory usage using CHAR_BITS and unsigned CHAR --- 56/69cd71a31b9bb3b64de3f1c6efe94b5d347f2b | 77 +++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 56/69cd71a31b9bb3b64de3f1c6efe94b5d347f2b diff --git a/56/69cd71a31b9bb3b64de3f1c6efe94b5d347f2b b/56/69cd71a31b9bb3b64de3f1c6efe94b5d347f2b new file mode 100644 index 000000000..b0c5cc846 --- /dev/null +++ b/56/69cd71a31b9bb3b64de3f1c6efe94b5d347f2b @@ -0,0 +1,77 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 39618431FB6 + for ; Sat, 16 Feb 2013 03:37:54 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id b0eBaf+q+GVQ for ; + Sat, 16 Feb 2013 03:37:53 -0800 (PST) +Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id AAFB7431FAF + for ; Sat, 16 Feb 2013 03:37:53 -0800 (PST) +Received: from fctnnbsc30w-156034082078.dhcp-dynamic.fibreop.nb.bellaliant.net + ([156.34.82.78] helo=zancas.localnet) + by tesseract.cs.unb.ca with esmtpsa + (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) + (envelope-from ) + id 1U6g5O-0004w8-O4; Sat, 16 Feb 2013 07:37:47 -0400 +Received: from bremner by zancas.localnet with local (Exim 4.80) + (envelope-from ) + id 1U6g5J-0007Hj-52; Sat, 16 Feb 2013 07:37:37 -0400 +From: David Bremner +To: Robert Mast , notmuch@notmuchmail.org +Subject: Re: [PATCH] bitmap:improve memory usage using CHAR_BITS and unsigned + CHAR +In-Reply-To: <1360769577-4861-1-git-send-email-beheerder@tekenbeetziekten.nl> +References: <1359917491-17178-1-git-send-email-beheerder@tekenbeetziekten.nl> + <1360769577-4861-1-git-send-email-beheerder@tekenbeetziekten.nl> +User-Agent: Notmuch/0.15.1 (http://notmuchmail.org) Emacs/24.2.1 + (x86_64-pc-linux-gnu) +Date: Sat, 16 Feb 2013 07:37:37 -0400 +Message-ID: <87halc7am6.fsf@zancas.localnet> +MIME-Version: 1.0 +Content-Type: text/plain +X-Spam_bar: - +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 16 Feb 2013 11:37:54 -0000 + +Robert Mast writes: + +> Using char instead of int allows for simpler definitions of the +> DOCIDSET macros so the code is easier to understand and consistent with +> respect to memory-usage. Estimated reduction of memory-usage for +> bitmap about 8 times. + +Pushed to master. + +I did a bit of testing, and this yields about a 7% improvement in the +total memory allocated on the medium corpus (running +performance-tests/M00-new) and about a 3% speedup running the large +corpus. These are definitely improvements worth having, but I think I +won't push it to the bug fix release, but rather wait for the next +regular release. + +d + + -- 2.26.2