Gentoo Archives: gentoo-performance

From: Sri Gupta <sri@×××××.com>
To: gentoo-performance@l.g.o
Subject: Re: [gentoo-performance] Re: portage performance
Date: Sat, 12 Jun 2004 20:20:34
Message-Id: 20040612201929.GA5132@tripadelic.com
In Reply to: [gentoo-performance] Re: portage performance by Jerry McBride
1 On Fri, Jun 11, 2004 at 11:02:53PM -0400, Jerry McBride wrote:
2 > Jesse Guardiani wrote:
3 >
4 > > Hello,
5 > >
6 > > First off, sorry if this isn't the right place!
7 > > I didn't see anything more appropriate though, except
8 > > perhaps Portage-dev, but I'm not a developer.
9 > >
10 > > I'm a FreeBSD user switching to Gentoo for my home
11 > > system. Linux 2.6 is a LOT more stable than any
12 > > FreeBSD 5.x-RELEASE kernels right now, and Linux
13 > > has much better support for Wine and such.
14 > >
15 > > One of the most obvious differences between FreeBSD
16 > > ports and Gentoo Portage is how LONG it takes to
17 > > search for ports/packages with Portage.
18 > >
19 > > I have 525 ports installed on my FreeBSD laptop right
20 > > now, and probably only half of that installed on the
21 > > Gentoo machine, but the gentoo machine crunches a lot
22 > > more doing a --search than the FreeBSD machine does
23 > > with a pkg_version -vs 'name'.
24 > >
25 > > And forget about --searchdesc! That takes ages!
26 > >
27 > > Is portage not hash indexed or something?
28 > >
29 >
30 > The main problem is this.... the portage database is a file system based
31 > mechanism. That is to say, when you update, search or otherwise use emerge,
32 > the program is busy as hell leafing through thousands of files looking for
33 > what you want..
34 >
35 > "Hashed", "indexed"??? Not even close....
36 >
37 > Portage is begging for a decent database engine and I pray it's sql
38 > based....
39 >
40 > The other hitch is that portage is written in an interpreted language,
41 > Python. Python is an excellent programming language, no doubt about it, but
42 > performance isn't one of it's highlights. Moving portage to C would be so
43 > much better....
44
45 Try using a JIT-style python compiler.
46
47 #emerge psyco
48 #nano -w `which emerge`
49
50 Add the bit from try: to pass in like so:
51
52 ----
53 import os,sys
54 os.environ["PORTAGE_CALLER"]="emerge"
55 sys.path = ["/usr/lib/portage/pym"]+sys.path
56
57 try:
58 import psyco
59 psyco.full()
60 except ImportError:
61 pass
62
63 import emergehelp,xpak,string,re,commands,time,shutil,traceback,atexit,signal,s...
64 ---
65
66 use tabs for the indented bits. you can also try the experimental
67 database support (I'm using it, seems fine)
68
69 # mkdir /etc/portage
70 # echo 'portdbapi.auxdbmodule="portage_db_anydbm.database"' > /etc/portage/modules
71 # echo 'eclass_cache.dbmodule="portage_db_anydbm.database"' >> /etc/portage/modules
72
73 Both of these speed up portage quite a bit...
74
75 -Sri

Replies

Subject Author
Re: [gentoo-performance] Re: portage performance Dylan Carlson <absinthe@g.o>
Re: [gentoo-performance] Re: portage performance Roman Gaufman <hackeron@×××××××××.com>