Gentoo Archives: gentoo-soc

From: "Александр Берсенев" <bay@×××××××××.ru>
To: gentoo-soc@l.g.o
Subject: Re: [gentoo-soc] rfc: reducing the time of "Calculating dependencies" phase project.
Date: Fri, 26 Apr 2013 11:43:36
Message-Id: CAPomEdzcwvv7DxTx2WVNqzScCy3O0e2aD94JEJ9LRb-V9TwnfQ@mail.gmail.com
In Reply to: Re: [gentoo-soc] rfc: reducing the time of "Calculating dependencies" phase project. by Zac Medico
1 Thanks for the answer,
2
3 I lke "frozen tree" approach, because I think that most users don't change
4 a package tree by hands.
5 In this case it would be nice to have a command to invalidate the
6 caches(like "yum clean" in yum).
7
8 The "Calculating dependencies" stage time is short on servers with few
9 packages installed. But the more packages one have installed, the more time
10 spent on "Calculating dependencies"(and also on "installing" phase). I seen
11 this on three my notebooks(between 2007-2013) and on my dedicated tinderbox
12 server, which tried to install every package in portage(and check for
13 missed dependencies).
14
15 I have got 8gb of RAM, so HDD is almost unused after first run.
16
17 Is it possingle to cache complete dependency graph(or parts of this graph)
18 between launches?
19 When I have been doing my last GSoC project(also about dependencies), I
20 didn't manage to find a database of reverse deps. If it is not exists, may
21 it be useful to create it to determine if full graph check is needed?
22
23 Best,
24 Alexander Bersenev
25
26
27 2013/4/26 Zac Medico <zmedico@g.o>
28
29 > On Thu, Apr 25, 2013 at 11:58 AM, Александр Берсенев <bay@×××××××××.ru>
30 > wrote:
31 > > Hello,
32 > >
33 > > my name is Alexander Bersenev, I am postgraduate of Institute of
34 > Mathematics
35 > > and Mechanics(Russia).
36 >
37 > Hello, it's nice to meet you.
38 >
39 > > I want to propose a project for GSoC 2013 and ask what do you think about
40 > > it.
41 > >
42 > > In short: I want to reduce the "Calculating dependencies" phase of
43 > emerge.
44 > >
45 > > On my notebook "emerge -pv bash" command takes 40 secs to calculate a
46 > deps.
47 > > If I launch it again, it take about 40 secs again(a have a lot of RAM, so
48 > > there was no HDD usage).
49 >
50 > A few things to note:
51 >
52 > 1) It will make a big difference if there is a bash version upgrade,
53 > or if the bash USE flags have changed. This is due to the
54 > --complete-graph-if-new-use and --complete-graph-if-new-ver options
55 > which are enabled by default. This behavior serves to protect
56 > reverse-dependencies from being broken.
57 >
58 2) Portage assumes that the portage tree can be modified between each
59 > emerge invocation. This is assumption necessary for development
60 > situations, but it has the disadvantage of introducing some extra
61 > overhead (comparing checksums of ebuilds and eclasses to the checksums
62 > found in the corresponding md5-cache entries). It would be possible to
63 > have an alternative "frozen tree" mode of operation which assumes that
64 > the portage tree can _not_ be modified between emerge invocations, and
65 > this mode would be more optimal for non-development situations.
66 >
67 > 3) Putting the portage tree on squashfs can help in some situations,
68 > since it allows the whole tree to easily fit into RAM and be accessed
69 > quickly.
70 >
71 > > Of course, quick cprofile profiling showed no places to optimize because
72 > > such optimizations already have been made.
73 > >
74 > > The main idea is add some caching layers(more high-level, than in
75 > > /usr/portage/metadata/md5-cache/). The main goal is to find and eliminate
76 > > repeated computations between "emerge" runs.
77 > >
78 > > As part of work I plan to examine approaches of other pkg managers(yum,
79 > > aptitude).
80 > >
81 > > I heard from Donnie Berkholz in IRC about pkgcore project. He said it
82 > works
83 > > faster in practice. But it has some problems with EAPI5 support.
84 > >
85 > > What is better: actualize a pkgcore code or try to dig into portage? Or
86 > it
87 > > is
88 > > the bad ideas at all?
89 >
90 > I suspect the pkgcore may already have a "frozen tree" mode, among
91 > other optimizations. However, it's not very useful until EAPI 5
92 > support is completed.
93 >
94 > Adding "frozen tree" support to portage might be a nice enhancement,
95 > but I'm not sure how much performance increase that it would yield.
96 > The --complete-graph-* options that I've mentioned introduce a large
97 > amount of overhead that could easily overshadow any performance
98 > increase that a "frozen tree" optimization would give you.
99 >
100 >

Replies