Package: apt-proxy Version: 1.9.25 Severity: important Tags: patch Hi,
On User Mode Linux, because of the fact that all system calls are thunked, the trick that you use to "ignore" the standard output actually takes a lot of time and CPU. By redirecting stdout to /dev/null the performance of apt-proxy improves significantly. In the attached patch, I do exactly that. I have not played with stderr, since there is commented out debugging code that will use the value that is calculated. That said, if it could be removed, I would lose no sleep ;-) Anyway, timings on my system (second run for both, so they are both running off of disk cache): old: Fetched 19.7MB in 23s (830kB/s) new: Fetched 19.7MB in 15s (1242kB/s) This will also make a difference on non-UML hosts, but the change will probably not be so great. Cheers, Paul -- System Information: Debian Release: 3.1 APT prefers unstable APT policy: (500, 'unstable'), (101, 'experimental') Architecture: i386 (i686) Kernel: Linux 2.6.10-1-k7 Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968) Versions of packages apt-proxy depends on: ii bzip2 1.0.2-3 high-quality block-sorting file co ii debconf 1.4.42 Debian configuration management sy ii logrotate 3.7-2 Log rotation utility ii python 2.3.4-6 An interactive high-level object-o ii python-apt 0.5.10 Python interface to libapt-pkg ii python-bsddb3 3.3.0-6 Python interface to libdb3 ii python-twisted 1.3.0-6 Event-based framework for internet -- debconf information: apt-proxy/upgrading-v2: apt-proxy/upgrading-v2-result:
Index: apt_proxy/apt_proxy.py =================================================================== RCS file: /cvsroot/apt-proxy/apt-proxy/apt_proxy/apt_proxy.py,v retrieving revision 1.104 diff -u -r1.104 apt_proxy.py --- apt_proxy/apt_proxy.py 26 Jan 2005 10:31:52 -0000 1.104 +++ apt_proxy/apt_proxy.py 30 Jan 2005 10:00:29 -0000 @@ -148,7 +148,8 @@ return log.debug("starting verification: " + exe + " " + str(args)) - self.process = reactor.spawnProcess(self, exe, args) + self.nullhandle = open("/dev/null", "w") + self.process = reactor.spawnProcess(self, exe, args, childFDs = { 0:"w", 1:self.nullhandle.fileno(), 2:"r" }) self.laterID = reactor.callLater(self.factory.timeout, self.timedout) def connectionMade(self):