unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Bremner <david@tethera.net>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: [PATCH 2/3] test/atomicity: guard chert-only optimization
Date: Wed,  6 Apr 2016 07:27:10 -0300	[thread overview]
Message-ID: <1459938431-28670-3-git-send-email-david@tethera.net> (raw)
In-Reply-To: <1459938431-28670-1-git-send-email-david@tethera.net>

This should potentially be updated to have an equivalent optimization
for the glass backend, but it in my unscientific tests, the glass backend
without the optimization is faster then the chert backend with.
---
 test/atomicity.py | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/test/atomicity.py b/test/atomicity.py
index 01a4205..1ca52b9 100644
--- a/test/atomicity.py
+++ b/test/atomicity.py
@@ -29,16 +29,19 @@ class RenameBreakpoint(gdb.Breakpoint):
         self.n = 0
 
     def stop(self):
-        # As an optimization, only consider snapshots after a Xapian
-        # has really committed.  Xapian overwrites record.base? as the
-        # last step in the commit, so keep an eye on their inumbers.
-        inodes = {}
-        for path in glob.glob('%s/.notmuch/xapian/record.base*' % maildir):
-            inodes[path] = os.stat(path).st_ino
-        if inodes == self.last_inodes:
-            # Continue
-            return False
-        self.last_inodes = inodes
+        xapiandir = '%s/.notmuch/xapian' % maildir
+        if os.path.isfile('%s/iamchert' % xapiandir):
+            # As an optimization, only consider snapshots after a
+            # Xapian has really committed.  The chert backend
+            # overwrites record.base? as the last step in the commit,
+            # so keep an eye on their inumbers.
+            inodes = {}
+            for path in glob.glob('%s/record.base*' % xapiandir):
+                inodes[path] = os.stat(path).st_ino
+            if inodes == self.last_inodes:
+                # Continue
+                return False
+            self.last_inodes = inodes
 
         # Save a backtrace in case the test does fail
         backtrace = gdb.execute('backtrace', to_string=True)
-- 
2.8.0.rc3

  parent reply	other threads:[~2016-04-06 10:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-05 11:18 WIP: update for xapian 1.3.5 David Bremner
2016-04-05 11:18 ` [PATCH 1/2] test: improve error handling in lib-error tests David Bremner
2016-04-06 10:27   ` Update test suite for glass backend David Bremner
2016-04-06 10:27     ` [PATCH 1/3] test: improve error handling in lib-error tests David Bremner
2016-04-06 10:27     ` David Bremner [this message]
2016-04-06 10:27     ` [PATCH 3/3] test: cope with glass backend file naming variations David Bremner
2016-04-07 13:57       ` Tomi Ollila
2016-04-05 11:18 ` [PATCH 2/2] WIP: update test suite for glass xapian backend David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1459938431-28670-3-git-send-email-david@tethera.net \
    --to=david@tethera.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).