From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/8492 Path: main.gmane.org!not-for-mail From: David Moore Newsgroups: gmane.emacs.gnus.general Subject: Re: mail fetching speed problems 5.2.25 Date: 25 Oct 1996 16:20:06 -0700 Sender: dmoore@sdnp5.ucsd.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035148643 12419 80.91.224.250 (20 Oct 2002 21:17:23 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:17:23 +0000 (UTC) Return-Path: Original-Received: (qmail 30579 invoked from smtpd); 25 Oct 1996 23:38:38 -0000 Original-Received: from ifi.uio.no (0@129.240.64.2) by deanna.miranova.com with SMTP; 25 Oct 1996 23:38:37 -0000 Original-Received: from UCSD.EDU (mailbox2.ucsd.edu [132.239.1.54]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Sat, 26 Oct 1996 01:20:53 +0200 Original-Received: from sdnp5.ucsd.edu (sdnp5.ucsd.edu [132.239.79.10]) by UCSD.EDU (8.8.2/8.6.9) with SMTP id QAA00117 for ; Fri, 25 Oct 1996 16:20:52 -0700 (PDT) Original-Received: by sdnp5.ucsd.edu (SMI-8.6/SMI-SVR4) id QAA27515; Fri, 25 Oct 1996 16:20:07 -0700 Original-To: (ding) GNUS Mailing List Original-Lines: 72 Xref: main.gmane.org gmane.emacs.gnus.general:8492 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:8492 David Moore writes: > > If this has been fixed, please let me know, I'll be upgrading to > red gnus this weekend anyways. > *** This is a structural problem with how gnus queries backends for new > *** messages, but might be fixable with adding some smarts to > *** nnmail-get-active or nnml-request-list. Oh boy, a self reply. Looking at the current rgnus source, the same problem seems to exist. nnmail-activate looks very wrong to me, since the nnml and other backends seem to set their own BACKEND-group-alist by calling nnmail-get-active directly. nnmail-activate calls BACKEND-request-list which generates the list, and then calls nnmail-get-active a second time on the same data. Changing nnmail-activate to not make the unneeded call and also changing the stored timestamp from (current-time) to 'file-time' (because of possible nfs and other interactions), I've now cut the time to fetch a single piece of new mail from 61 seconds to about 15, when using a non-byte-compiled version of nnmail-activate. Of course, a lot of time is still being wasted here. New version: (defun nnmail-activate (backend &optional force) (let (file timestamp file-time) (if (or (not (symbol-value (intern (format "%s-group-alist" backend)))) force (and (setq file (condition-case () (symbol-value (intern (format "%s-active-file" backend))) (error nil))) (setq file-time (nth 5 (file-attributes file))) (or (not (setq timestamp (condition-case () (symbol-value (intern (format "%s-active-timestamp" backend))) (error 'none)))) (not (consp timestamp)) (equal timestamp '(0 0)) (> (nth 0 file-time) (nth 0 timestamp)) (and (= (nth 0 file-time) (nth 0 timestamp)) (> (nth 1 file-time) (nth 1 timestamp)))))) (save-excursion (or (eq timestamp 'none) (set (intern (format "%s-active-timestamp" backend)) ;;; dmoore@ucsd.edu 25.10.96 ;;; it's not always the case that current-time ;;; does correspond to changes in the file's time. So just compare ;;; the file's new time against its own previous time. ;;; (current-time) file-time )) (funcall (intern (format "%s-request-list" backend))) ;;; dmoore@ucsd.edu 25.10.96 ;;; BACKEND-request-list already does this itself! ;;; (set (intern (format "%s-group-alist" backend)) ;;; (nnmail-get-active)) )) t)) -- David Moore | Computer Systems Lab __o UCSD Dept. Computer Science - 0114 | Work: (619) 534-8604 _ \<,_ La Jolla, CA 92093-0114 | Fax: (619) 534-1445 (_)/ (_) | Solo Furnace Creek 508 -- 1996!