[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Receiving network data causes excessive consing
From: |
Jesper Harder |
Subject: |
Receiving network data causes excessive consing |
Date: |
Tue, 13 Jan 2004 04:17:14 +0100 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
In GNU Emacs 21.3.50.21 (i686-pc-linux-gnu, GTK+ Version 2.0.2)
of 2004-01-10 on defun.localdomain
configured using `configure '--with-gtk''
Hi!
I noticed that receiving data from a network process conses madly.
Here's a test case (it fetches the active list from news.gmane.org):
(let (m1 process)
(with-current-buffer (get-buffer-create " *test*")
(erase-buffer))
(setq process (open-network-stream "test" " *test*" "news.gmane.org" 119))
(setq m1 (memory-use-counts))
(process-send-string process "LIST\n")
(sit-for 50)
(process-send-string process "QUIT\n")
(mapcar* '- (memory-use-counts) m1))
=> (48055 3 0 0 509059 2 0 2063)
(with-current-buffer " *test*" (buffer-size))
=> 252123
I.e. it conses roughly two char-cells for every byte of data received!
I understand that it would be necessary to cons strings if the process
had process filters -- but it seems rather excessive without filters
where I would have thought that we could do without consing ... I
also wonder why all those cons cells are created.
Emacs 20.5 seems to do a lot better[1] -- I get this result for the
same test:
(4103 0 0 0 4168 0 0)
[1] I don't have Emacs 21 and 20.5 on the same box, though. The
machine with 20.5 has a much faster network connection, and a
different architecture:
In GNU Emacs 20.5.1 (alphaev56-dec-osf4.0d, X toolkit)
of Mon May 15 2000 on uniddec.uni-c.dk
configured using `configure --prefix=/usr/unic/share/emacs/20.5
--sharedstatedir=/usr/unic/share/emacs/20.5
--exec-prefix=/usr/unic/libexec/emacs/20.5
--x-libraries=/usr/X11R6/lib
--x-includes=/usr/X11R6/include:/usr/openwin/share/include --with-pop'
- Receiving network data causes excessive consing,
Jesper Harder <=