Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Portage getting too big and too slow
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Nic-E
n00b
n00b


Joined: 08 Nov 2002
Posts: 6
Location: South Africa

PostPosted: Mon Aug 25, 2003 2:49 pm    Post subject: Portage getting too big and too slow Reply with quote

I have been noticing a steady decline in emerge/portage perfomance. First i thought it was just the crappy box i am using at work. But i have noticed other Gentoo installations as the same.
It takes forever just to search for a app. Can anyone tell me why this is happening?? Is there some way of speeding up emerge? I have heard of ppl porting emerge from python to C. Why is portage not following this yet?
_________________
--
Nic-E
-[^_^]-
Back to top
View user's profile Send private message
scriptkiddie
l33t
l33t


Joined: 30 Mar 2003
Posts: 955

PostPosted: Mon Aug 25, 2003 2:53 pm    Post subject: Reply with quote

The Dux Linux team is taking Portage and converting it from Python to C and also adding the MySQL support for the database instead of text files.

It will run much faster and should be easier to update..

Maybe you could try cleaning up your files and such in distfiles and packages to make it run faster
Back to top
View user's profile Send private message
maxmc
Guru
Guru


Joined: 14 Oct 2002
Posts: 480
Location: Linköping, Sweden

PostPosted: Mon Aug 25, 2003 6:08 pm    Post subject: Reply with quote

Is there a link available?
Back to top
View user's profile Send private message
scriptkiddie
l33t
l33t


Joined: 30 Mar 2003
Posts: 955

PostPosted: Mon Aug 25, 2003 6:10 pm    Post subject: Reply with quote

we have a non informative web site up right now at:
http://dux.sunsite.dk

The website that actually contains information will be set up this weekend at:
www.dux-linux.org
Back to top
View user's profile Send private message
BitJam
Advocate
Advocate


Joined: 12 Aug 2003
Posts: 2508
Location: Silver City, NM

PostPosted: Mon Aug 25, 2003 6:53 pm    Post subject: Reply with quote

There are at least two ebuilds floating around that speed up emerge searches so much as to make them painless. I use esearch. It is in portage but masked as experimental.
Code:
ACCEPT_KEYWORDS="~x86" emerge esearch
eupdatedb
esearch whatever
esearch -S keyword


Or do a search on these fora for esearch to find the other package that does just about the same thing.

The downside of these packages is that they take a minute or two to build up their databases. I just ran eupdatedb and it took 90 secs. Even so, I love the thing and highly recommend it.
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9530
Location: beyond the rim

PostPosted: Mon Aug 25, 2003 9:38 pm    Post subject: Reply with quote

The other downside of these scripts is that the results are static, so version numbers and (less likely) other fields might be wrong/outdated.

BTW, I wrote the other script, fastsearch, but I think esearch is better for everyday use as it uses the same output format as emerge -s (fastsearch is rather limited at the moment and I don't know if I'm going to change that)
Back to top
View user's profile Send private message
smiler.se
Tux's lil' helper
Tux's lil' helper


Joined: 18 Aug 2003
Posts: 115
Location: Sweden - Europe - Earth

PostPosted: Mon Aug 25, 2003 9:52 pm    Post subject: Reply with quote

See this thread for some more info and discussions on this subject.
_________________
Christian

Sig out of date. Please upgrade to a newer one.
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Mon Aug 25, 2003 11:38 pm    Post subject: Reply with quote

quite simply, C isn't that much faster than Python. Especially when the program is waiting on data from the disk (i.e. emerge -S app).

Python was chosen for portage because it's faster than most interpreted languages (like BASH), it's object orientated and _very_ easy to pick up, which means rapid development, which is essential for something so important to an ever changing distro.

A MySQL backend is a very good idea, but thats about the largest speed increase you'll see out of hacking portage. Perhaps some speed hacking on some dirty portage code could speed it up, but it's normally pretty good.
Back to top
View user's profile Send private message
quixoticsycophant
n00b
n00b


Joined: 10 Jan 2003
Posts: 16

PostPosted: Tue Aug 26, 2003 1:41 am    Post subject: Reply with quote

Quote:
A MySQL backend is a very good idea,

I think this would create difficulties with regard to dealing with a malfunctioning system (very important!). What if there is problem and you need to start up mysql to view the data, but you can't start up mysql because you have a problem. It also smells a little like the Windows Registry (and I'll allow everyone to have their own opinion about that beast).

Or did you mean an *optional* MySQL database which redundantly mirrors the current /var/db/pkg setup? I'd be all for that.

Quote:
but thats about the largest speed increase you'll see out of hacking portage. Perhaps some speed hacking on some dirty portage code could speed it up, but it's normally pretty good.

Actually that isn't true. With /usr/db/pkg cached (i.e. NO disk hits), the following perl script does the same thing as emerge -S but 18 times faster (1.35 seconds vs 24.22 seconds).

Code:
#!/usr/bin/perl

die "Usage: $0 <regular-expression>\n" unless @ARGV == 1 ;

use warnings ;
use strict ;

use File::Find () ;

my $tree = "/usr/portage" ;
my $search = shift ;
my $ebuilds = {} ;

sub each_ebuild
{
    return unless m!\.ebuild$!o ;
    my($cat,$pkg) = m!^$tree/(.*?)/(.*?)/!o ;
    return unless $cat ;
    return unless $pkg ;
    return if exists $ebuilds->{$cat} and exists $ebuilds->{$cat}->{$pkg} ;

    local @ARGV = ($_) ;
    while(<>)
    {
        my($desc) = m!DESCRIPTION\s*?\=\s*\"(.*?)\"!o ;
   
        if( $desc and ($desc =~ m!$search!i or $pkg =~ m!$search!i) )
        {
            $ebuilds->{$cat}->{$pkg} = $desc ;
            last ;
        }
    }
}

File::Find::find({ no_chdir => 1, wanted =>\&each_ebuild }, $tree) ;

for my $cat (sort keys %$ebuilds)
{
    for my $pkg (sort keys %{$ebuilds->{$cat}})
    {
        print "$cat/$pkg: $ebuilds->{$cat}->{$pkg}\n" ;
    }
}

The point is that simply optimizing disk I/O is not enough. The whole kit and kaboodle needs to be overhauled. Still, it is true that disk I/O should be first on the agenda.

-qs
Back to top
View user's profile Send private message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Tue Aug 26, 2003 9:36 am    Post subject: Reply with quote

putting it in mysql would require mysql to be working... that's far from always the case, and I really wouldn't like that aproach... would be much better to cache stuff.
Back to top
View user's profile Send private message
scriptkiddie
l33t
l33t


Joined: 30 Mar 2003
Posts: 955

PostPosted: Tue Aug 26, 2003 12:02 pm    Post subject: Reply with quote

it would have to be an optional thing for Gentoo.. as for Dux, we can consider it default over the standard way..

Why would you say that MySQL does not work? I have never had a single problem with it and I use it for some heavy stuff
Back to top
View user's profile Send private message
neuron
Advocate
Advocate


Joined: 28 May 2002
Posts: 2371

PostPosted: Tue Aug 26, 2003 1:53 pm    Post subject: Reply with quote

I use it a lot myself, and it's great, but I have experienced problems between versions. Either way, using huge package lik mysql rather than storing stuff on the file system, isn't such a great idea imho.
Back to top
View user's profile Send private message
SNo0py
Apprentice
Apprentice


Joined: 12 Jul 2002
Posts: 270
Location: Vienna, Austria

PostPosted: Tue Aug 26, 2003 2:25 pm    Post subject: Reply with quote

KISS - keep it simple and stupid.

What if somebody doesn't want to have mysql on his computer? Does rsync work with a mysql database?

I think it should be left as it is, but there should be a fast caching...
_________________
Sex is like hacking. You get in, you get out, and you hope you didnt leave something behind that can be traced back to you.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum