* Making browsing a foreign server faster
@ 2001-12-28 0:51 Jesper Harder
2001-12-28 19:23 ` Paul Jarc
2001-12-28 23:32 ` Lars Magne Ingebrigtsen
0 siblings, 2 replies; 3+ messages in thread
From: Jesper Harder @ 2001-12-28 0:51 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 2808 bytes --]
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]
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-srvr.el.diff --]
[-- Type: text/x-patch, Size: 946 bytes --]
--- ../../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)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-12-28 23:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-28 0:51 Making browsing a foreign server faster Jesper Harder
2001-12-28 19:23 ` Paul Jarc
2001-12-28 23:32 ` Lars Magne Ingebrigtsen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).