--- /dev/null
+Return-Path: <matt@bubblegen.co.uk>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 5118F431FC0\r
+ for <notmuch@notmuchmail.org>; Wed, 25 Mar 2015 04:21:16 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 1.738\r
+X-Spam-Level: *\r
+X-Spam-Status: No, score=1.738 tagged_above=-999 required=5\r
+ tests=[DNS_FROM_AHBL_RHSBL=2.438, RCVD_IN_DNSWL_LOW=-0.7]\r
+ autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id O9BI78NpV+9z for <notmuch@notmuchmail.org>;\r
+ Wed, 25 Mar 2015 04:21:13 -0700 (PDT)\r
+Received: from avasout07.plus.net (avasout07.plus.net [84.93.230.235])\r
+ (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id DDB02431FBC\r
+ for <notmuch@notmuchmail.org>; Wed, 25 Mar 2015 04:21:12 -0700 (PDT)\r
+Received: from webmail04.plus.net ([84.93.228.66]) by avasout07 with smtp\r
+ id 7nM61q0031SbfYc01nM66W; Wed, 25 Mar 2015 11:21:09 +0000\r
+X-CM-Score: 0.00\r
+X-CNFS-Analysis: v=2.1 cv=fZwjyigF c=1 sm=1 tr=0\r
+ a=C5+YawzV8SR07mwocaP9vA==:117 a=Pqgwzd+QtBWunNm/3vzkeA==:17\r
+ a=0Bzu9jTXAAAA:8\r
+ a=fne2aKG5GRsA:10 a=wPDyFdB5xvgA:10 a=80hmnl3cAAAA:8 a=emO1SXQWCLwA:10\r
+ a=Q767GAiA_D4PB-lXPuYA:9 a=wPNLvfGTeEIA:10 a=tclcd6dtLQvEqt9_mmAA:9\r
+ a=OFIISnGhPB6JD1Ix4xkA:9\r
+Received: from localhost ([127.0.0.1] helo=webmail.plus.net)\r
+ by webmail04.plus.net with esmtp (Exim 4.76)\r
+ (envelope-from <matt@bubblegen.co.uk>)\r
+ id 1YajMv-00040P-U0; Wed, 25 Mar 2015 11:21:06 +0000\r
+Received: from 216.31.211.11 (proxying for unknown)\r
+ (SquirrelMail authenticated user bubblegen+matt)\r
+ by webmail.plus.net with HTTP; Wed, 25 Mar 2015 11:21:06 -0000\r
+Message-ID: <49796ef89d505ab1039478982568a0b9.squirrel@webmail.plus.net>\r
+In-Reply-To: <m2d23xv7e8.fsf@guru.guru-group.fi>\r
+References: <5511DE10.80107@bubblegen.co.uk>\r
+ <87384u6lgb.fsf@maritornes.cs.unb.ca>\r
+ <m2d23xv7e8.fsf@guru.guru-group.fi>\r
+Date: Wed, 25 Mar 2015 11:21:06 -0000\r
+Subject: Re: emacs / vim - time taken to open threads\r
+From: "Matthew Lear" <matt@bubblegen.co.uk>\r
+To: "Tomi Ollila" <tomi.ollila@iki.fi>\r
+User-Agent: SquirrelMail\r
+MIME-Version: 1.0\r
+Content-Type: multipart/mixed;boundary="----=_20150325112105_65244"\r
+X-Priority: 3 (Normal)\r
+Importance: Normal\r
+Cc: Matthew Lear <matt@bubblegen.co.uk>, notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+Reply-To: matt@bubblegen.co.uk\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 25 Mar 2015 11:21:16 -0000\r
+\r
+------=_20150325112105_65244\r
+Content-Type: text/plain; charset="iso-8859-1"\r
+Content-Transfer-Encoding: 8bit\r
+\r
+>> My experience is that the emacs interface is faster than the vim one.\r
+>> At least I don't have an examples handy where emacs is slower than the\r
+>> vim interface at rendering a thread. At a wild guess, I suspect it has\r
+>> to do with how many attachments there are, and the emacs UI being\r
+>> overenthusiastic about processing attachements.\r
+>\r
+> I've seen over 15 seconds of load time when opening some 20+ message\r
+> thread -- and jumping through messages has been slow in emacs ui.\r
+\r
+Here's two attachments obtained using the in-built profiler in emacs 24 -\r
+one for memory profiling and one for cpu. This particular thread took > 30\r
+secs to load and emacs was locked up the entire time. I'm no lisp expert,\r
+but perhaps somebody could interpret this and possible suggest what could\r
+be going on..? W.r.t. both cpu and memory usage, quite a lot of time seems\r
+to be spent in indent-rigidly and notmuch-show-insert-thread.\r
+\r
+Cheers,\r
+-- Matt\r
+------=_20150325112105_65244\r
+Content-Type: text/plain; name="cpu.txt"\r
+Content-Transfer-Encoding: 8bit\r
+Content-Disposition: attachment; filename="cpu.txt"\r
+\r
+\r
+------=_20150325112105_65244\r
+Content-Type: text/plain; name="mem.txt"\r
+Content-Transfer-Encoding: 8bit\r
+Content-Disposition: attachment; filename="mem.txt"\r
+\r
+- command-execute 1,274,239,745 99%\r
+ - call-interactively 1,274,239,745 99%\r
+ - notmuch-search-show-thread 1,244,222,992 97%\r
+ - notmuch-show 1,244,222,992 97%\r
+ - notmuch-show-build-buffer 1,244,184,644 97%\r
+ - notmuch-show-insert-forest 1,052,295,452 82%\r
+ - mapc 1,052,295,452 82%\r
+ - #<compiled 0xd784f3> 1,052,295,452 82%\r
+ - notmuch-show-insert-thread 1,052,295,452 82%\r
+ - mapc 1,052,295,452 82%\r
+ - #<compiled 0xd784cd> 1,052,295,452 82%\r
+ - notmuch-show-insert-tree 1,052,295,452 82%\r
+ - notmuch-show-insert-thread 840,006,831 65%\r
+ - mapc 840,006,831 65%\r
+ - #<compiled 0xd784cd> 840,006,831 65%\r
+ - notmuch-show-insert-tree 840,006,831 65%\r
+ - notmuch-show-insert-thread 475,772,280 37%\r
+ - mapc 475,772,280 37%\r
+ - #<compiled 0xd784cd> 475,772,280 37%\r
+ - notmuch-show-insert-tree 475,772,280 37%\r
+ - notmuch-show-insert-thread 393,675,698 30%\r
+ - mapc 393,675,698 30%\r
+ - #<compiled 0xd784cd> 393,675,698 30%\r
+ - notmuch-show-insert-tree 393,675,698 30%\r
+ - notmuch-show-insert-msg 393,670,578 30%\r
+ indent-rigidly 378,976,399 29%\r
+ + notmuch-show-insert-headers 8,573,181 0%\r
+ + notmuch-show-strip-re 38,912 0%\r
+ + notmuch-show-insert-headerline 21,748 0%\r
+ + notmuch-show-message-visible 5,264 0%\r
+ notmuch-show-set-message-properties 3,096 0%\r
+ make-overlay 1,418 0%\r
+ + notmuch-show-insert-msg 82,096,582 6%\r
+ - notmuch-show-insert-msg 364,233,495 28%\r
+ + notmuch-show-insert-body 237,892,232 18%\r
+ indent-rigidly 123,850,002 9%\r
+ + notmuch-show-insert-headers 377,077 0%\r
+ + notmuch-show-insert-headerline 85,340 0%\r
+ + notmuch-show-strip-re 20,556 0%\r
+ + notmuch-show-headers-visible 4,208 0%\r
+ + notmuch-show-message-visible 1,056 0%\r
+ - notmuch-show-insert-msg 212,283,421 16%\r
+ indent-rigidly 155,843,920 12%\r
+ + notmuch-show-insert-body 51,496,368 4%\r
+ + notmuch-show-insert-headers 379,990 0%\r
+ + notmuch-show-insert-headerline 93,694 0%\r
+ + notmuch-show-strip-re 17,802 0%\r
+ + notmuch-show-message-visible 1,056 0%\r
+ + notmuch-show-set-message-properties 1,056 0%\r
+ - notmuch-query-get-threads 180,741,671 14%\r
+ - apply 180,741,671 14%\r
+ - notmuch-call-notmuch-sexp 180,741,671 14%\r
+ - notmuch-call-notmuch--helper 175,917,905 13%\r
+ apply 175,917,905 13%\r
+ + make-temp-file 101,654 0%\r
+ generate-new-buffer 1,029 0%\r
+ + jit-lock-register 11,145,353 0%\r
+ + notmuch-show-strip-re 1,144 0%\r
+ replace-regexp-in-string 1,024 0%\r
+ + notmuch-show-goto-first-wanted-message 24,480 0%\r
+ + switch-to-buffer 12,839 0%\r
+ + helm-M-x 29,989,777 2%\r
+ + previous-line 17,280 0%\r
+ + next-line 9,696 0%\r
++ notmuch-show-command-hook 266,546 0%\r
++ ... 44,578 0%\r
+- redisplay_internal (C function) 7,648 0%\r
+ file-remote-p 5,600 0%\r
+ + kill-this-buffer-enabled-p 2,048 0%\r
+ mouse-fixup-help-message 1,024 0%\r
+\r
+------=_20150325112105_65244--\r
+\r
+\r