proposed fix for memory leak in notmuch restore
[notmuch-archives.git] / af / 083a430edf021ce29b2b2fb7cca293742b2fca
1 Return-Path: <cworth@cworth.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 7BF93431FBF;\r
6         Mon,  7 Dec 2009 09:53:35 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id wKSberaKw8ne; Mon,  7 Dec 2009 09:53:34 -0800 (PST)\r
11 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
12         by olra.theworths.org (Postfix) with ESMTP id 7A41B431FAE;\r
13         Mon,  7 Dec 2009 09:53:34 -0800 (PST)\r
14 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
15         id 3257D2542FB; Mon,  7 Dec 2009 09:53:34 -0800 (PST)\r
16 From: Carl Worth <cworth@cworth.org>\r
17 To: Alexander Botero-Lowry <alex.boterolowry@gmail.com>,\r
18         notmuch@notmuchmail.org\r
19 In-Reply-To:\r
20  <86bpid10h1.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me>\r
21 References:\r
22  <86bpid10h1.fsf@fortitudo.i-did-not-set--mail-host-address--so-tickle-me>\r
23 Date: Mon, 07 Dec 2009 09:53:33 -0800\r
24 Message-ID: <87d42qvffm.fsf@yoom.home.cworth.org>\r
25 MIME-Version: 1.0\r
26 Content-Type: multipart/signed; boundary="=-=-=";\r
27         micalg=pgp-sha1; protocol="application/pgp-signature"\r
28 Subject: Re: [notmuch] slowdown with large html heavy threads\r
29 X-BeenThere: notmuch@notmuchmail.org\r
30 X-Mailman-Version: 2.1.12\r
31 Precedence: list\r
32 List-Id: "Use and development of the notmuch mail system."\r
33         <notmuch.notmuchmail.org>\r
34 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
35         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
36 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
37 List-Post: <mailto:notmuch@notmuchmail.org>\r
38 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
39 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
40         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
41 X-List-Received-Date: Mon, 07 Dec 2009 17:53:35 -0000\r
42 \r
43 --=-=-=\r
44 Content-Transfer-Encoding: quoted-printable\r
45 \r
46 On Sat, 05 Dec 2009 15:10:18 -0800, Alexander Botero-Lowry <alex.boterolowr=\r
47 y@gmail.com> wrote:\r
48 > Carl mentioned that he saw some nasty performance issues with threads\r
49 > that had a lot of HTML messages in them.\r
50 >=20\r
51 > If you are experiencing this problem, would you mind trying some\r
52 > alternative mm-text-html-renderer setting:\r
53 >=20\r
54 > http://mh-e.sourceforge.net/manual/html/HTML.html\r
55 >=20\r
56 > Also, if you have elinks, I recommend my custom renderer:\r
57 >=20\r
58 > (require 'mm-view)\r
59 > (add-to-list 'mm-text-html-renderer-alist=20\r
60 >   '(elinks mm-inline-render-with-stdin nil "elinks" "-force-html" "-dump"=\r
61 ))\r
62 > (setq mm-text-html-renderer 'elinks)\r
63 \r
64 Hi Alex,\r
65 \r
66 I'm sorry, but the delays got in my way so much this morning that I\r
67 reverted the patch before even attempting the alternate renderer.\r
68 \r
69 Part of my annoyance may have been due to a distinct bug. There was\r
70 definitely one instance where I was seeing a big delay when trying to\r
71 display a tiny thread (about 13 messages) none of which were HTML. I\r
72 reverted the HTML-rendering patch and saw the delay go away, but I also\r
73 put the patch back and didn't see the problem come back.\r
74 \r
75 So that problem might have been form something else. But when I looked\r
76 at the patch and saw that it was doing this:\r
77 \r
78 =2D            (let ((filename (notmuch-show-get-filename)))\r
79 =2D              (with-temp-buffer\r
80 =2D                (insert-file-contents filename nil nil nil t)\r
81 \r
82 for every file, (regardless of it being HTML or not), I was convinced\r
83 that there's got to be a better way. Notmuch has already passed the\r
84 entire thread through GMime, so we really don't want to do a second pass\r
85 of all of the raw message content through an emacs-lisp MIME parser as\r
86 well.\r
87 \r
88 Instead, let's find a way to just get the information from GMime to be\r
89 cheaply available for emacs to look at (without loading all of the\r
90 original files).\r
91 \r
92 =2DCarl\r
93 \r
94 \r
95 --=-=-=\r
96 Content-Type: application/pgp-signature\r
97 \r
98 -----BEGIN PGP SIGNATURE-----\r
99 Version: GnuPG v1.4.10 (GNU/Linux)\r
100 \r
101 iD8DBQFLHUEe6JDdNq8qSWgRAoSrAJ4xWJCqU+5KzlMw2qDIeWxyNzAe1gCfbcA9\r
102 FkICm7CqfcMjJ3ey6TK/Pcc=\r
103 =hJO7\r
104 -----END PGP SIGNATURE-----\r
105 --=-=-=--\r