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 3296C431FBC for ; Fri, 23 Jan 2015 08:47:06 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.562 X-Spam-Level: X-Spam-Status: No, score=-2.562 tagged_above=-999 required=5 tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_HI=-5] autolearn=disabled 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 yP9-aQ8sV9Y5 for ; Fri, 23 Jan 2015 08:47:03 -0800 (PST) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id DD35A431FC9 for ; Fri, 23 Jan 2015 08:47:02 -0800 (PST) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t0NGkxjR028783 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 23 Jan 2015 11:46:59 -0500 Received: from localhost.localdomain (ovpn-113-119.phx2.redhat.com [10.3.113.119]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t0NGkvG0006074 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Fri, 23 Jan 2015 11:46:57 -0500 Date: Fri, 23 Jan 2015 08:46:56 -0800 From: Ian Main To: Franz Fellner Message-ID: <54c27b00aa954_3921f3b3308@ovo.mains.priv.notmuch> In-Reply-To: <1421957807-26273-1-git-send-email-alpine.art.de@gmail.com> References: <1421957807-26273-1-git-send-email-alpine.art.de@gmail.com> Subject: RE: [PATCH] VIM: Improve performance of folders_render Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Attach: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Cc: notmuch@notmuchmail.org 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: Fri, 23 Jan 2015 16:47:06 -0000 Yes, LGTM. This greatly improves performance of the startup screen. Ian Franz Fellner wrote: > Simply use query.count_[messages,threads] instead of actually running > the query and using the count attribute of the result set. > --- > vim/notmuch.vim | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/vim/notmuch.vim b/vim/notmuch.vim > index cb6695a..ad8b7c8 100644 > --- a/vim/notmuch.vim > +++ b/vim/notmuch.vim > @@ -644,7 +644,7 @@ ruby << EOF > q.add_tag_exclude(t) > } > $searches << search > - count = count_threads ? q.search_threads.count : q.search_messages.count > + count = count_threads ? q.count_threads : q.count_messages > b << "%9d %-20s (%s)" % [count, name, search] > end > end > -- > 2.2.1 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch