From 89753cb63d14c235d12153616003c11edfb10651 Mon Sep 17 00:00:00 2001 From: Franz Fellner Date: Thu, 22 Jan 2015 21:16:47 +0100 Subject: [PATCH] [PATCH] VIM: Improve performance of folders_render --- 68/75dfe254d714cc4a84c52a2d008600918ca61f | 82 +++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 68/75dfe254d714cc4a84c52a2d008600918ca61f diff --git a/68/75dfe254d714cc4a84c52a2d008600918ca61f b/68/75dfe254d714cc4a84c52a2d008600918ca61f new file mode 100644 index 000000000..0af1c5d5a --- /dev/null +++ b/68/75dfe254d714cc4a84c52a2d008600918ca61f @@ -0,0 +1,82 @@ +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 04B61431FCB + for ; Thu, 22 Jan 2015 12:17:03 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 1.639 +X-Spam-Level: * +X-Spam-Status: No, score=1.639 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + DNS_FROM_AHBL_RHSBL=2.438, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] 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 NUVSHExwZDg5 for ; + Thu, 22 Jan 2015 12:16:59 -0800 (PST) +Received: from mail-we0-f179.google.com (mail-we0-f179.google.com + [74.125.82.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 54822431FC9 + for ; Thu, 22 Jan 2015 12:16:59 -0800 (PST) +Received: by mail-we0-f179.google.com with SMTP id q59so3888954wes.10 + for ; Thu, 22 Jan 2015 12:16:58 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id; + bh=JMOj2lP4obMBa233D8s+aD6MiS2pkJYpQD75NFZZHDg=; + b=DWNHLPuNeQzVoZgz+GVwDr+5Yg4PUewofbKwL49E8XrERBbyyGYxI2puVSHjIYSNZc + 3rGmJcmHgQbfUF2iW34kf8CkVigc7At3kFXoILVr1XNsWOrIoZgPCQeSjy1PLL+hBPYI + +hO6eC1ppzN19AJ0Iy8CP37D+A5rQEhAkf1xGHtqkKnqr41Ne5ny0b8PyOAEM7pt/TcV + fwpa2bA2vWsAf04cW7WcrgOEK0HPrteJHdnNmzAg7F8mTuWcuDbsyYKBrRcnoKrJsIWC + GaswhAgpIvfrXkqAao45U0mFgCZamZPy6Y+oGjrvYhE9xJoD7zlFGoehZUEPlFWX9y5o + C1vA== +X-Received: by 10.194.237.202 with SMTP id ve10mr6904685wjc.36.1421957818073; + Thu, 22 Jan 2015 12:16:58 -0800 (PST) +Received: from localhost (p579BA329.dip0.t-ipconnect.de. [87.155.163.41]) + by mx.google.com with ESMTPSA id fo15sm124328wic.19.2015.01.22.12.16.56 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Thu, 22 Jan 2015 12:16:57 -0800 (PST) +From: Franz Fellner +To: notmuch@notmuchmail.org +Subject: [PATCH] VIM: Improve performance of folders_render +Date: Thu, 22 Jan 2015 21:16:47 +0100 +Message-Id: <1421957807-26273-1-git-send-email-alpine.art.de@gmail.com> +X-Mailer: git-send-email 2.2.1 +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, 22 Jan 2015 20:17:03 -0000 + +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 + -- 2.26.2