From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68851 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: Gnus' speed Date: Thu, 30 Jul 2009 08:33:33 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87d47i70sy.fsf@lifelogs.com> References: <87zlao7j1z.fsf@CPU107.opentrends.net> <87iqhb7w7a.fsf@CPU107.opentrends.net> <873a8f8i0b.fsf@lifelogs.com> <871vnysodu.fsf@rimspace.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1248961903 15514 80.91.229.12 (30 Jul 2009 13:51:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 30 Jul 2009 13:51:43 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M17271@lists.math.uh.edu Thu Jul 30 15:51:36 2009 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1MWW2i-0005lr-83 for ding-account@gmane.org; Thu, 30 Jul 2009 15:51:36 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1MWW1r-0007yV-6D; Thu, 30 Jul 2009 08:50:43 -0500 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1MWVlT-0007tY-Gg for ding@lists.math.uh.edu; Thu, 30 Jul 2009 08:33:47 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1MWVlS-0007qf-Jt for ding@lists.math.uh.edu; Thu, 30 Jul 2009 08:33:47 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1MWVm1-00054n-00 for ; Thu, 30 Jul 2009 15:34:21 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1MWVlQ-0002Eo-7K for ding@gnus.org; Thu, 30 Jul 2009 13:33:44 +0000 Original-Received: from 38.98.147.130 ([38.98.147.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Jul 2009 13:33:44 +0000 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 30 Jul 2009 13:33:44 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 62 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 38.98.147.130 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:2TiLMdCVgX1tTptyQiSgkt4dBaE= X-Spam-Score: -1.5 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:68851 Archived-At: On Thu, 30 Jul 2009 15:58:37 +1000 Daniel Pittman wrote: DP> Ted Zlatanov writes: >> I think the backend rewrite would be fairly minor, but there are many >> internal and user-visible functions in Gnus that also will need to be >> modified. It's a lot of work. DP> I think that saying "fairly minor" is misleading here: adding the capability DP> to the IMAP backend isn't enormously hard, but defining a sound (and portable) DP> API, and implementing it, is quite non-trivial. I'd do it with the IMAP convention of "1.2.3" to mean part 3 of part 2 of part 1 as an optional parameter for the backend command to fetch the body, and an extra backend command to get a message's structure (list of strings as above with the associated data). I'd move all the rest of the code into a separate async-bodypart-fetch library that, given a list of body parts, can interact with the existing Gnus user-facing functionality that builds and interacts with the article buffer. The async-bodypart-fetch library should be usable by other ELisp-basedmail clients, so it should not depend on any Gnus code. DP> As a guide, if someone does want to do this, from when I investigated this DP> some time back I found the best strategy was likely to be: DP> 1. Define an API for "obtain the MIME structure" in the back-ends. DP> 2. Implement it in the "front-end" based on fetching the whole article. DP> You need this later anyhow. DP> 3. Replace all the bits of code scattered all over the place that take the DP> whole article and look for structure with use of the API above. DP> Just keep fetching the whole article and all at this point, when it comes DP> to getting the data out. DP> 4. Replace the front-end MIME structure code with a back-end API, and use the DP> same code for the default implementation for back-ends that don't provide DP> an optimized version. DP> 5. Maybe, add an IMAP version at this point. DP> 6. Define an API for fetching a MIME part based on the structure. DP> 7. Provide a default implementation, then move down code that parses the DP> article into parts into the content. DP> 8. Replace all the code that assumes it sits in a full article buffer with DP> something like '(gnes-in-article-buffer &body)' that will build a suitable DP> buffer, then run the old code. DP> 9. Gradually replace instances of that with content-aware versions of the DP> same. DP> That way you can release something useful along the way, building useful code DP> at each stage, without having to get everything done at once. You can look DP> forward to person-months if not person-years of work in the transition, DP> though. Your itemized list seems very thorough and you've obviously thought about this more than I. Are you interested in coordinating this effort? If we present it appropriately (especially that it benefits all ELisp mail clients, not just Gnus) we may get more help from the core Emacs developers. I could work on the backend fetch and the async-bodypart-fetch library, but I doubt I would be helpful on the front end, especially the code that generates the article buffer from a message body. Ted