From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/41010 Path: main.gmane.org!not-for-mail From: Jesper Harder Newsgroups: gmane.emacs.gnus.general Subject: Making browsing a foreign server faster Date: Fri, 28 Dec 2001 01:51:50 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035176477 3948 80.91.224.250 (21 Oct 2002 05:01:17 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:01:17 +0000 (UTC) Return-Path: Original-Received: (qmail 25923 invoked from network); 28 Dec 2001 01:00:57 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 28 Dec 2001 01:00:57 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16JlMU-0007Xr-00; Thu, 27 Dec 2001 18:59:02 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Thu, 27 Dec 2001 18:58:53 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id SAA19088 for ; Thu, 27 Dec 2001 18:58:42 -0600 (CST) Original-Received: (qmail 25259 invoked by alias); 28 Dec 2001 00:58:36 -0000 Original-Received: (qmail 25254 invoked from network); 28 Dec 2001 00:58:35 -0000 Original-Received: from fepc.post.tele.dk (195.41.46.147) by gnus.org with SMTP; 28 Dec 2001 00:58:35 -0000 Original-Received: from defun.localdomain ([195.215.96.251]) by fepC.post.tele.dk (InterMail vM.4.01.03.23 201-229-121-123-20010418) with ESMTP id <20011228005832.LDNB11568.fepC.post.tele.dk@defun.localdomain> for ; Fri, 28 Dec 2001 01:58:32 +0100 Original-To: ding@gnus.org X-Face: &>4YWj)5jy97[$J|&W(MX>,:L.9*|o]WXwhY40_'#-Yc:J-&v+U*?uhK9cqS'eaG(SLj0o E)IS]Ua_g,_"S$Xv)V5^T<^s?U8Tt6XZ~2EdDl^]={px>)aE[grl6~~G`7:vKu!:tZ_.L6,g7qV[; vn><9`4hh(Pf^gH'EJ[!c/$Jog51Q Original-Lines: 49 User-Agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:41010 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:41010 --=-=-= It takes a long time to get and display an active file with Gnus. I did a little profiling. These number are for showing the active file of my local news server twice (it has ca. 48.000 groups): Function Name Call Count Elapsed Time Average Time ========================================= ========== ============ ============ gnus-server-read-server 2 199.092545 99.5462725 gnus-browse-foreign-server 2 199.086051 99.5430255 gnus-group-prefixed-name 97248 38.465528999 0.0003955405 gnus-server-equal 97248 26.304658999 0.0002704904 gnus-add-text-properties 97390 9.0370400000 9.279...e-05 gnus-group-level 97248 7.4187510000 7.628...e-05 gnus-group-name-decode 97432 6.9541069999 7.137...e-05 gnus-group-name-charset 97340 6.8508260000 7.038...e-05 gnus-request-list 2 6.579343 3.2896715 nntp-request-list 2 6.579015 3.2895075 nntp-send-command-and-decode 2 6.5783070000 3.2891535000 nntp-accept-process-output 31 4.5154390000 0.1456593225 gnus-server-to-method 97320 3.2123899999 3.300...e-05 A lot of time is spent in `gnus-group-prefixed-name' because it's called on every iteration in the inner loop. This shouldn't be necessary, because I think the prefix is the same for every group on the server(?). So, I tried to move it outside of the loop [1], which turns out to be around 20% faster: Function Name Call Count Elapsed Time Average Time ========================================= ========== ============ ============ gnus-server-read-server 2 154.793711 77.3968555 gnus-browse-foreign-server 2 154.78735 77.393675 gnus-add-text-properties 97392 9.8606260000 0.0001012467 gnus-group-name-charset 97342 9.2035850000 9.454...e-05 gnus-request-list 2 6.51363 3.256815 nntp-request-list 2 6.513376 3.256688 nntp-send-command-and-decode 2 6.5125790000 3.2562895000 gnus-group-name-decode 97436 5.2722589999 5.410...e-05 nntp-accept-process-output 33 4.3882959999 0.1329786666 gnus-group-level 97248 4.3642049999 4.487...e-05 It's probably not a totally clean way of doing it, so I don't know if the speed improvement is worth it. [1] --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=gnus-srvr.el.diff --- ../../gnus/lisp/gnus-srvr.el Fri Dec 28 00:42:06 2001 +++ gnus-srvr.el Thu Dec 27 23:23:12 2001 @@ -726,7 +726,9 @@ (list (format "Gnus: %%b {%s:%s}" (car method) (cadr method)))) - (let ((buffer-read-only nil) charset) + (let ((buffer-read-only nil) charset + (prefix (let ((gnus-select-method orig-select-method)) + (gnus-group-prefixed-name "" method)))) (while groups (setq group (car groups)) (setq charset (gnus-group-name-charset method (car group))) @@ -735,11 +737,7 @@ (prog1 (1+ (point)) (insert (format "%c%7d: %s\n" - (let ((level - (let ((gnus-select-method orig-select-method)) - (gnus-group-level - (gnus-group-prefixed-name (car group) - method))))) + (let ((level (gnus-group-level (concat prefix (car group))))) (cond ((<= level gnus-level-subscribed) ? ) ((<= level gnus-level-unsubscribed) ?U) --=-=-=--