tomi.ollila at iki.fi
Tue Feb 21 03:23:11 PST 2012
On Tue, 21 Feb 2012 09:15:09 -0000, Justus Winter <4winter at informatik.uni-hamburg.de> wrote:
> Quoting Daniel Schoepe (2012-02-17 02:28:52) [emphasis mine]:
> >Just for completeness: I'm using the nice nottoomuch-addresses.pl script
> > by Tomi Ollila *which doesn't require any bindings* and is incredibly
> >fast (after generating an initial address database).
> I don't get it. The perl script isn't using any library bindings,
> mainly because there are no libnotmuch bindings for perl. *But* it
> does call the notmuch binary which is worse:
> * incredibly high overhead (fork&exec) compared to a simple function
> call (plus maybe some kind of ffi)
> * manual and error prone serialization of ''function arguments''
> * manual and error prone deserialization of ''return values''
> * very limited error reporting and handling capabilities
> * any kind of resource (think handle to a xapian database) is lost if
> the process exists resulting in further overhead if the binary is
> called multiple times
Shortly answering nottoomuch-addresses.sh's (version 2.0) point of view.
Searching from "database" is done using fgrep. that means 2 forks, 2 execs
from command line (it used to be one fork but now we handle fgrep return
value) (fork, exec /bin/sh, fork, exec fgrep). Anyway, usually matches are
printed out by fgrep before ENTER key has risen (or TAB when run from
The "database" is created by perl program ("embedded" in
nottoomuch-addresses.sh), it executes notmuch once to get all email
filenames (since beginning of time or since last update) -- the perl code
then parses email addresses out of those files, cleans those up, removes
duplicates and writes those to the "database" files (all and one with
ignored removed)... So that newest are in top of the file, returned first
in fgrep(1) execution.
> I do get the feeling that it is perceived as desirable not to require
> any kind of notmuch bindings (David once said something similar about
> If that's the case I'd love to hear why and if there's anything we can
> do about it.
It would be nice if notmuch(1) itself had command to be used for
address completion. I wonder how feasible it is to get a good implementation
More information about the notmuch