Re: [PATCH v4 13/16] add indexopts to notmuch python bindings.
[notmuch-archives.git] / a6 / 3f769d2628cc56b9c4e0b66ec67f70c1785d7f
1 Return-Path: <bremner@tethera.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5  by arlo.cworth.org (Postfix) with ESMTP id 2E9FD6DE0355\r
6  for <notmuch@notmuchmail.org>; Fri,  8 Apr 2016 18:50:17 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.02\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.009,\r
12   SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id 5di1jpOFmryZ for <notmuch@notmuchmail.org>;\r
16  Fri,  8 Apr 2016 18:50:09 -0700 (PDT)\r
17 Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
18  by arlo.cworth.org (Postfix) with ESMTPS id 0B5B86DE02CD\r
19  for <notmuch@notmuchmail.org>; Fri,  8 Apr 2016 18:50:00 -0700 (PDT)\r
20 Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
21  (envelope-from <bremner@tethera.net>)\r
22  id 1aoi2L-00022e-Sz; Fri, 08 Apr 2016 21:50:09 -0400\r
23 Received: (nullmailer pid 6632 invoked by uid 1000);\r
24  Sat, 09 Apr 2016 01:49:55 -0000\r
25 From: David Bremner <david@tethera.net>\r
26 To: notmuch@notmuchmail.org\r
27 Subject: [PATCH 2/4] test/atomicity: guard chert-only optimization\r
28 Date: Fri,  8 Apr 2016 22:49:48 -0300\r
29 Message-Id: <1460166590-6526-3-git-send-email-david@tethera.net>\r
30 X-Mailer: git-send-email 2.8.0.rc3\r
31 In-Reply-To: <1460166590-6526-1-git-send-email-david@tethera.net>\r
32 References: <1460166590-6526-1-git-send-email-david@tethera.net>\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.20\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37  <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
39  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
44  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Sat, 09 Apr 2016 01:50:17 -0000\r
46 \r
47 This should potentially be updated to have an equivalent optimization\r
48 for the glass backend, but it in my unscientific tests, the glass backend\r
49 without the optimization is faster then the chert backend with.\r
50 ---\r
51  test/atomicity.py | 23 +++++++++++++----------\r
52  1 file changed, 13 insertions(+), 10 deletions(-)\r
53 \r
54 diff --git a/test/atomicity.py b/test/atomicity.py\r
55 index 01a4205..1ca52b9 100644\r
56 --- a/test/atomicity.py\r
57 +++ b/test/atomicity.py\r
58 @@ -29,16 +29,19 @@ class RenameBreakpoint(gdb.Breakpoint):\r
59          self.n = 0\r
60  \r
61      def stop(self):\r
62 -        # As an optimization, only consider snapshots after a Xapian\r
63 -        # has really committed.  Xapian overwrites record.base? as the\r
64 -        # last step in the commit, so keep an eye on their inumbers.\r
65 -        inodes = {}\r
66 -        for path in glob.glob('%s/.notmuch/xapian/record.base*' % maildir):\r
67 -            inodes[path] = os.stat(path).st_ino\r
68 -        if inodes == self.last_inodes:\r
69 -            # Continue\r
70 -            return False\r
71 -        self.last_inodes = inodes\r
72 +        xapiandir = '%s/.notmuch/xapian' % maildir\r
73 +        if os.path.isfile('%s/iamchert' % xapiandir):\r
74 +            # As an optimization, only consider snapshots after a\r
75 +            # Xapian has really committed.  The chert backend\r
76 +            # overwrites record.base? as the last step in the commit,\r
77 +            # so keep an eye on their inumbers.\r
78 +            inodes = {}\r
79 +            for path in glob.glob('%s/record.base*' % xapiandir):\r
80 +                inodes[path] = os.stat(path).st_ino\r
81 +            if inodes == self.last_inodes:\r
82 +                # Continue\r
83 +                return False\r
84 +            self.last_inodes = inodes\r
85  \r
86          # Save a backtrace in case the test does fail\r
87          backtrace = gdb.execute('backtrace', to_string=True)\r
88 -- \r
89 2.8.0.rc3\r
90 \r