--- /dev/null
+Return-Path: <bremner@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 50F036DE02DD\r
+ for <notmuch@notmuchmail.org>; Wed, 6 Apr 2016 03:27:29 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.02\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.009,\r
+ SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id PXJLn4erIQ7V for <notmuch@notmuchmail.org>;\r
+ Wed, 6 Apr 2016 03:27:20 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id F32C46DE0243\r
+ for <notmuch@notmuchmail.org>; Wed, 6 Apr 2016 03:27:19 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1ankgi-00033H-Vu; Wed, 06 Apr 2016 06:27:53 -0400\r
+Received: (nullmailer pid 28740 invoked by uid 1000);\r
+ Wed, 06 Apr 2016 10:27:16 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+Subject: [PATCH 2/3] test/atomicity: guard chert-only optimization\r
+Date: Wed, 6 Apr 2016 07:27:10 -0300\r
+Message-Id: <1459938431-28670-3-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.8.0.rc3\r
+In-Reply-To: <1459938431-28670-1-git-send-email-david@tethera.net>\r
+References: <1459855082-5715-2-git-send-email-david@tethera.net>\r
+ <1459938431-28670-1-git-send-email-david@tethera.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 06 Apr 2016 10:27:29 -0000\r
+\r
+This should potentially be updated to have an equivalent optimization\r
+for the glass backend, but it in my unscientific tests, the glass backend\r
+without the optimization is faster then the chert backend with.\r
+---\r
+ test/atomicity.py | 23 +++++++++++++----------\r
+ 1 file changed, 13 insertions(+), 10 deletions(-)\r
+\r
+diff --git a/test/atomicity.py b/test/atomicity.py\r
+index 01a4205..1ca52b9 100644\r
+--- a/test/atomicity.py\r
++++ b/test/atomicity.py\r
+@@ -29,16 +29,19 @@ class RenameBreakpoint(gdb.Breakpoint):\r
+ self.n = 0\r
+ \r
+ def stop(self):\r
+- # As an optimization, only consider snapshots after a Xapian\r
+- # has really committed. Xapian overwrites record.base? as the\r
+- # last step in the commit, so keep an eye on their inumbers.\r
+- inodes = {}\r
+- for path in glob.glob('%s/.notmuch/xapian/record.base*' % maildir):\r
+- inodes[path] = os.stat(path).st_ino\r
+- if inodes == self.last_inodes:\r
+- # Continue\r
+- return False\r
+- self.last_inodes = inodes\r
++ xapiandir = '%s/.notmuch/xapian' % maildir\r
++ if os.path.isfile('%s/iamchert' % xapiandir):\r
++ # As an optimization, only consider snapshots after a\r
++ # Xapian has really committed. The chert backend\r
++ # overwrites record.base? as the last step in the commit,\r
++ # so keep an eye on their inumbers.\r
++ inodes = {}\r
++ for path in glob.glob('%s/record.base*' % xapiandir):\r
++ inodes[path] = os.stat(path).st_ino\r
++ if inodes == self.last_inodes:\r
++ # Continue\r
++ return False\r
++ self.last_inodes = inodes\r
+ \r
+ # Save a backtrace in case the test does fail\r
+ backtrace = gdb.execute('backtrace', to_string=True)\r
+-- \r
+2.8.0.rc3\r
+\r