On Tue, 21 Feb 2012 09:15:09 -0000, Justus Winter <4winter@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 > >[1] 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: I think that emphasis you added may be a bit misleading: I specifically mentioned that it doesn't need bindings, because the initial problem in this thread had to do with missing bindings, not because I think it's inherently a good thing. The reason I mentioned nottoomuch-addresses at all, is that completion itself is _a lot_ faster (at least for me), compared to addrlookup. According to the wiki, notmuch-addresses.py is even slower than addrlookup, so I thought (and still think) that it was worth mentioning. Of course, one could rewrite the database-generation part in python using the bindings, but I personally don't think it's that necessary. > * incredibly high overhead (fork&exec) compared to a simple function > call (plus maybe some kind of ffi) I think nottoomuch-addresses.sh is a good example how such performance considerations can be outweighed by choosing a good "algorithm" instead (extracting all addresses beforehand). > * 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 > > 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 > nmbug). While I don't think that using bindings is a bad thing, the fact that we can do non-trivial things like nmbug without them, seems to be a good indicator for the quality of the command line interface though. (And hence notmuch lends itself well to being used in shell scripts). Cheers, Daniel