Re: nomuch_addresses.py
authorTomi Ollila <tomi.ollila@iki.fi>
Tue, 21 Feb 2012 11:23:11 +0000 (13:23 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:44:46 +0000 (09:44 -0800)
f9/d082930c84a86dbd98073a56f55c08c37c5099 [new file with mode: 0644]

diff --git a/f9/d082930c84a86dbd98073a56f55c08c37c5099 b/f9/d082930c84a86dbd98073a56f55c08c37c5099
new file mode 100644 (file)
index 0000000..d934d20
--- /dev/null
@@ -0,0 +1,103 @@
+Return-Path: <tomi.ollila@iki.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 1D512431FAF\r
+       for <notmuch@notmuchmail.org>; Tue, 21 Feb 2012 03:23:16 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id oth3pO9UUnKp for <notmuch@notmuchmail.org>;\r
+       Tue, 21 Feb 2012 03:23:12 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru-group.fi [87.108.86.66])\r
+       by olra.theworths.org (Postfix) with ESMTP id 29FB8431FAE\r
+       for <notmuch@notmuchmail.org>; Tue, 21 Feb 2012 03:23:12 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 4CFCA68055; Tue, 21 Feb 2012 13:23:11 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Justus Winter <4winter@informatik.uni-hamburg.de>,\r
+       Daniel Schoepe <daniel@schoepe.org>,\r
+       Philippe LeCavalier <support@plecavalier.com>, notmuch@notmuchmail.org\r
+Subject: Re: nomuch_addresses.py\r
+In-Reply-To: <20120221091509.8534.59492@thinkbox.jade-hamburg.de>\r
+References: <87r4xur3rv.fsf@plc.plecavalier.com>\r
+       <87fweamenf.fsf@schoepe.localhost>\r
+       <20120221091509.8534.59492@thinkbox.jade-hamburg.de>\r
+User-Agent: Notmuch/0.11.1+198~g922c4d2 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+       $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+       !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Tue, 21 Feb 2012 13:23:11 +0200\r
+Message-ID: <m2zkcc4ehs.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 21 Feb 2012 11:23:16 -0000\r
+\r
+On Tue, 21 Feb 2012 09:15:09 -0000, Justus Winter <4winter@informatik.uni-hamburg.de> wrote:\r
+> Quoting Daniel Schoepe (2012-02-17 02:28:52) [emphasis mine]:\r
+> >Just for completeness: I'm using the nice nottoomuch-addresses.pl script\r
+> >[1] by Tomi Ollila *which doesn't require any bindings* and is incredibly\r
+> >fast (after generating an initial address database).\r
+> \r
+> I don't get it. The perl script isn't using any library bindings,\r
+> mainly because there are no libnotmuch bindings for perl. *But* it\r
+> does call the notmuch binary which is worse:\r
+> \r
+> * incredibly high overhead (fork&exec) compared to a simple function\r
+>   call (plus maybe some kind of ffi)\r
+> * manual and error prone serialization of ''function arguments''\r
+> * manual and error prone deserialization of ''return values''\r
+> * very limited error reporting and handling capabilities\r
+> * any kind of resource (think handle to a xapian database) is lost if\r
+>   the process exists resulting in further overhead if the binary is\r
+>   called multiple times\r
+\r
+Shortly answering nottoomuch-addresses.sh's (version 2.0) point of view.\r
+\r
+Searching from "database" is done using fgrep. that means 2 forks, 2 execs\r
+from command line (it used to be one fork but now we handle fgrep return\r
+value) (fork, exec /bin/sh, fork, exec fgrep). Anyway, usually matches are\r
+printed out by fgrep before ENTER key has risen (or TAB when run from\r
+emacs).\r
+\r
+The "database" is created by perl program ("embedded" in\r
+nottoomuch-addresses.sh), it executes notmuch once to get all email\r
+filenames (since beginning of time or since last update) -- the perl code\r
+then parses email addresses out of those files, cleans those up, removes\r
+duplicates and writes those to the "database" files (all and one with\r
+ignored removed)... So that newest are in top of the file, returned first\r
+in fgrep(1) execution.\r
+\r
+> I do get the feeling that it is perceived as desirable not to require\r
+> any kind of notmuch bindings (David once said something similar about\r
+> nmbug).\r
+> \r
+> If that's the case I'd love to hear why and if there's anything we can\r
+> do about it.\r
+\r
+It would be nice if notmuch(1) itself had command to be used for\r
+address completion. I wonder how feasible it is to get a good implementation\r
+there...\r
+\r
+> \r
+> Justus\r
+\r
+Tomi\r