Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 951B84196F0 for ; Thu, 15 Apr 2010 13:04:43 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.301 X-Spam-Level: X-Spam-Status: No, score=-2.301 tagged_above=-999 required=5 tests=[BAYES_40=-0.001, RCVD_IN_DNSWL_MED=-2.3] autolearn=unavailable Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PAiCPFC8LfpL for ; Thu, 15 Apr 2010 13:04:40 -0700 (PDT) Received: from ipex3.johnshopkins.edu (ipex3.johnshopkins.edu [128.220.161.140]) by olra.theworths.org (Postfix) with ESMTP id 6CFF4431FC1 for ; Thu, 15 Apr 2010 13:04:40 -0700 (PDT) X-IronPort-AV: E=Sophos;i="4.52,214,1270440000"; d="scan'208";a="375289513" Received: from c-69-255-36-229.hsd1.md.comcast.net (HELO lucky) ([69.255.36.229]) by ipex3.johnshopkins.edu with ESMTP/TLS/AES256-SHA; 15 Apr 2010 16:04:39 -0400 Received: from jkr by lucky with local (Exim 4.69) (envelope-from ) id 1O2VIk-00013V-IO; Thu, 15 Apr 2010 16:04:38 -0400 From: Jesse Rosenthal To: Carl Worth , Xavier Maillard , Mark Anderson , notmuch@notmuchmail.org Subject: Re: [notmuch] Bulk message tagging In-Reply-To: <87fx2xfs4q.fsf@yoom.home.cworth.org> References: <87sk7b30tg.fsf@jhu.edu> <3wdmxxg4axm.fsf@testarossa.amd.com> <87fx2xfs4q.fsf@yoom.home.cworth.org> Date: Thu, 15 Apr 2010 16:04:38 -0400 Message-ID: <87tyrcwkh5.fsf@jhu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Apr 2010 20:04:43 -0000 On Wed, 14 Apr 2010 17:59:01 -0700, Carl Worth wrote: > We could fix all[*] the bugs of "*" by changing it to simply call the > new region-based tagging function. The only concern I have with that is > that it might be significantly slower, (it will execute N "notmuch tag" > commands to tag the N threads in the current buffer, rather than just > one "notmuch tag" command with the same search). Not quite true: the region command only executes one "notmuch tag" command over "id:X or id:Y or id:Z or ...". It does have to iterate over the messages to get the ids, and again to set the tags (i.e., write them in the buffer), but that's all in the buffer -- there's only one xapian command. And anything that updates the buffer in real time would have to iterate through the messages to rewrite the tag representation, so I'm not sure if there's that much being lost here. That being said, there might be a bit of redundancy (one save-excursion trip through the buffer to get the tags for completion, another to get the ids, and one more to rewrite the parenthetical tag representation). But I'm not quite sure how to avoid that, or how expensive it actually is. Best, Jesse