Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP] Using psyco to speed up emerge
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Hackeron
Guru
Guru


Joined: 01 Nov 2002
Posts: 307

PostPosted: Sat Oct 16, 2004 4:58 pm    Post subject: Reply with quote

Not to stay behind everyone, here are my results :)

Notice that you dont need except: pass anymore and it makes things marginally faster.

Code:

portage-2.0.50-r11  emerge -ep world
1ghz via c3-2 nehemiah 512Mb PC2700
-----------------------------------

         REAL       USER        SYS

psyco.full()
        0m41.919s 0m36.447s 0m5.002s
        0m42.046s 0m36.539s 0m5.006s
        0m42.089s 0m36.430s 0m5.154s

psyco.log(); psyco.full()
        0m42.098s 0m36.559s 0m5.010s
        0m42.101s 0m36.508s 0m5.040s
        0m42.230s 0m36.374s 0m5.319s

psyco.full(); except pass
        0m42.127s 0m36.569s 0m5.028s
        0m42.440s 0m36.388s 0m5.275s
        0m42.265s 0m36.423s 0m5.188s

psyco.profile()
        0m49.296s 0m42.820s 0m5.844s
        0m49.037s 0m42.642s 0m5.756s
        0m49.179s 0m42.839s 0m5.741s

psyco.log(); psyco.profile()
        0m49.450s 0m43.109s 0m5.746s
        0m49.417s 0m42.917s 0m5.865s
        0m49.575s 0m43.173s 0m5.804s

nothing;
        0m49.623s 0m44.142s 0m4.856s
        0m49.543s 0m44.050s 0m4.933s
        0m49.648s 0m44.121s 0m4.910s

psyco.log(); psyco.profile(0.2)
        0m54.920s 0m48.323s 0m5.889s
        0m55.047s 0m48.585s 0m5.767s
        0m56.631s 0m48.424s 0m6.463s
Back to top
View user's profile Send private message
angelacb
n00b
n00b


Joined: 31 Oct 2003
Posts: 50

PostPosted: Mon Oct 18, 2004 11:28 pm    Post subject: Reply with quote

Viha wrote:
Segfaulted here on emerge clean (portage 2.0.51_rc9).


Same here, it seems the latest portage update doesn't like psyco anymore.

Best Regards,
_________________
Love Linux, Love Life
Back to top
View user's profile Send private message
Rainmaker
Veteran
Veteran


Joined: 12 Feb 2004
Posts: 1650
Location: /home/NL/ehv/

PostPosted: Tue Jan 18, 2005 4:34 pm    Post subject: Reply with quote

Psyco seems to work again with the latest ~x86 version of portage.

With psyco:
emerge -eDvp world 5,67s user 1,96s system 70% cpu 10,837 total

without psyco:
emerge -eDvp world 8,62s user 1,94s system 92% cpu 11,372 total

It seems faster, also the CPU usage goes down. Looks OK.

Although the difference might be small, it has no adverse affects as far as I can tell... So why not use it? :D

This is on a AMD 2500 XP with 1 Gig of RAM. I'll try it on a lowerspec machine in a minute.

OK, on my Pentium 200 with 128 Megs of RAM:

with:
real 0m35.453s
user 0m32.210s
sys 0m2.920s

without:
real 0m50.887s
user 0m47.200s
sys 0m3.250s

That's a pretty good increase. I guess the lower the specs, the higher the difference :D
_________________
If you can't dazzle them with brilliance, baffle them with bullshit.
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Tue Jan 18, 2005 6:50 pm    Post subject: Reply with quote

Which version ?
It causes segfaults on portage 2.0.51-r13.
Back to top
View user's profile Send private message
Rainmaker
Veteran
Veteran


Joined: 12 Feb 2004
Posts: 1650
Location: /home/NL/ehv/

PostPosted: Tue Jan 18, 2005 9:40 pm    Post subject: Reply with quote

Portage 2.0.51-r13...

Code:
user@Medusa$ head -n 20 `which emerge`                                    (~)
#!/usr/bin/python -O
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-src/portage/bin/emerge,v 1.345.2.12 2005/01/13 18:17:45 carpaski Exp $

try:
    import psyco
    psyco.full()
except ImportError:
    pass

import os,sys
os.environ["PORTAGE_CALLER"]="emerge"
sys.path = ["/usr/lib/portage/pym"]+sys.path

import portage

import emergehelp,xpak,string,re,commands,time,shutil,traceback,atexit,signal,socket,types
from stat import *
from output import *

_________________
If you can't dazzle them with brilliance, baffle them with bullshit.
Back to top
View user's profile Send private message
Vaporz
n00b
n00b


Joined: 10 Sep 2004
Posts: 45

PostPosted: Tue Jan 18, 2005 11:59 pm    Post subject: Reply with quote

i let emerge -e world run quite a few times, to cache all it wanted, then i ran with psyco, used time both times of course, and there was a nice improvement
is there any downside to this?
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Wed Jan 19, 2005 11:35 am    Post subject: Reply with quote

Rainmaker wrote:
Portage 2.0.51-r13...


Try emerging something for real: just before it finishes: segfault, every time, until I remove those few psyco-lines from /usr/bin/emerge.
Back to top
View user's profile Send private message
CH[eese]
n00b
n00b


Joined: 16 May 2005
Posts: 2
Location: England, UK

PostPosted: Mon Aug 22, 2005 9:47 pm    Post subject: Reply with quote

I can also confirm segfaults here. And I was stupid enough to enter it in as a bug in Bugzilla, before I realised that I had modified emerge. ( https://bugs.gentoo.org/show_bug.cgi?id=102040 )

I won't be modifying emerge again. Heh.

[edit: Uh, whoops. Sorry, didn't notice the thread was over half a year old...]
_________________
Formerly known as "Ciaran". Please note: I'm not ciaranm. This is an entirely different Ciaran. ;)
Back to top
View user's profile Send private message
eremini
Apprentice
Apprentice


Joined: 27 May 2005
Posts: 157

PostPosted: Tue Aug 30, 2005 7:29 am    Post subject: Reply with quote

Unmask and install the latest version of psyco and it'll all be working again.
Back to top
View user's profile Send private message
Dr-Munir
n00b
n00b


Joined: 14 Jun 2005
Posts: 17

PostPosted: Wed Oct 05, 2005 2:39 pm    Post subject: Reply with quote

polle wrote:
I get this error:

File "/usr/bin/emerge", line 12
except ImportError:
^
SyntaxError: invalid syntax

I tried to copy and paste from the above but still get that error
(used nano to edit the file /usr/bin/emerge and tried with and without a space before except)



Here`s what I got, same as your error, But I managed to get around that ......

here is the output.
Code:
Goofy portage # emerge -u -f kde
Traceback (most recent call last):
  File "/usr/bin/emerge", line 78, in ?
    if "candy" in portage.settings.features:
NameError: name 'portage' is not defined
Goofy portage # emerge -u -f kde
Traceback (most recent call last):
  File "/usr/bin/emerge", line 74, in ?
    if "candy" in portage.settings.features:
NameError: name 'portage' is not defined
Goofy portage # emerge -u -f kde
Traceback (most recent call last):
  File "/usr/bin/emerge", line 74, in ?
    if "candy" in portage.settings.features:
NameError: name 'portage' is not defined
Goofy portage # emerge -u -f kde
  File "/usr/bin/emerge", line 12
    import psyco
    ^
SyntaxError: invalid syntax
Goofy portage # emerge -u -f kde
  File "/usr/bin/emerge", line 14
    except ImporrError:
         ^
SyntaxError: invalid syntax
Goofy portage # emerge -u -f kde
  File "/usr/bin/emerge", line 14
    except ImportError:
         ^
SyntaxError: invalid syntax
Goofy portage # emerge -u -f kde
  File "/usr/bin/emerge", line 14
    except  ImportError:
    ^
SyntaxError: invalid syntax
Goofy portage # emerge -u -f kde
Calculating dependencies ...done!
>>> emerge (1 of 135) sys-devel/patch-2.5.9-r1 to /
>>> Previously fetched file: patch-2.5.9.tar.gz size ;-)
>>> Previously fetched file: patch-2.5.9.tar.gz MD5 ;-)
>>> md5 files   ;-) patch-2.5.9.ebuild
>>> md5 files   ;-) patch-2.5.9-r1.ebuild
>>> md5 files   ;-) files/digest-patch-2.5.9-r1
>>> md5 files   ;-) files/digest-patch-2.5.9
>>> md5 files   ;-) files/patch-2.5.9-cr-stripping.patch
>>> md5 src_uri ;-) patch-2.5.9.tar.gz
>>> emerge (2 of 135) sys-devel/libperl-5.8.7 to /
>>> Resuming download...
>>> Downloading http://mirror.datapipe.net/gentoo/distfiles/perl-5.8.7.tar.bz2
--00:15:32--  http://mirror.datapipe.net/gentoo/distfiles/perl-5.8.7.tar.bz2
           => `/usr/portage/distfiles/perl-5.8.7.tar.bz2'
Resolving mirror.datapipe.net... 64.27.65.115
Connecting to mirror.datapipe.net[64.27.65.115]:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 9,839,086 (1,121,909 to go) [application/x-bzip2]

90% [++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++=>            ] 8,868,020      6.46K/s    ETA 03:35

Exiting on signal 2
Goofy portage # emerge -u -f kde
  File "/usr/bin/emerge", line 13
    psyco.full ()
    ^
SyntaxError: invalid syntax
Goofy portage # emerge -u -f kde
  File "/usr/bin/emerge", line 13
    psyco.full()
    ^
SyntaxError: invalid syntax
Goofy portage # emerge -u -f kde


Performing Global Updates: /usr/portage/profiles/updates/3Q-2005
(Could take a couple of minutes if you have a lot of binary packages.)
  .='update pass'  *='binary update'  @='/var/db move'
  s='/var/db SLOT move' S='binary SLOT move' p='update /etc/portage/package.*'
.............................................................................



 ** Skipping packages. Run 'fixpackages' or set it in FEATURES to fix the
    tbz2's in the packages directory. Note: This can take a very long time.
    alculating dependencies ...done!
>>> emerge (1 of 142) sys-devel/patch-2.5.9-r1 to /
>>> Previously fetched file: patch-2.5.9.tar.gz size ;-)
>>> Previously fetched file: patch-2.5.9.tar.gz MD5 ;-)
>>> md5 files   ;-) patch-2.5.9.ebuild
>>> md5 files   ;-) patch-2.5.9-r1.ebuild
>>> md5 files   ;-) files/digest-patch-2.5.9-r1
>>> md5 files   ;-) files/digest-patch-2.5.9
>>> md5 files   ;-) files/patch-2.5.9-cr-stripping.patch
>>> md5 src_uri ;-) patch-2.5.9.tar.gz
>>> emerge (2 of 142) sys-devel/libperl-5.8.7 to /
QA Notice: USE Flag 'userland_Darwin' not in IUSE for sys-devel/libperl-5.8.7
>>> Resuming download...
>>> Downloading http://mirror.datapipe.net/gentoo/distfiles/perl-5.8.7.tar.bz2
--00:22:48--  http://mirror.datapipe.net/gentoo/distfiles/perl-5.8.7.tar.bz2
           => `/usr/portage/distfiles/perl-5.8.7.tar.bz2'
Resolving mirror.datapipe.net... 64.27.65.115
Connecting to mirror.datapipe.net[64.27.65.115]:80... connected.
HTTP request sent, awaiting response... 206 Partial Content
Length: 9,839,086 (971,066 to go) [application/x-bzip2]


what I did in the end was that I indented using the TAB key, and thats it.

but what worries me that it then started to check for the Global Updates as you can see :


Code:
Performing Global Updates: /usr/portage/profiles/updates/3Q-2005
(Could take a couple of minutes if you have a lot of binary packages.)
  .='update pass'  *='binary update'  @='/var/db move'
  s='/var/db SLOT move' S='binary SLOT move' p='update /etc/portage/package.*'
.............................................................................



 ** Skipping packages. Run 'fixpackages' or set it in FEATURES to fix the
    tbz2's in the packages directory. Note: This can take a very long time.


I dunno Why!!!!





EDIT: Oops , I didnt Know I was Too Late to Participate in this discussion....
_________________
When Everything is Meant To Be Broken, I Just Want To Know Who I Am.
Back to top
View user's profile Send private message
vm
n00b
n00b


Joined: 19 Mar 2006
Posts: 50

PostPosted: Mon Apr 03, 2006 3:54 am    Post subject: Reply with quote

psyco is great but platform-dependent, it doesnt work on PowerPC platforms for example,
AND IF YOURE WRITING A PYTHON CODE,
DONT USE psyco AT ALL !

do that only for test goals but never for anything else
Back to top
View user's profile Send private message
Hypnos
Advocate
Advocate


Joined: 18 Jul 2002
Posts: 2889
Location: Omnipresent

PostPosted: Fri May 12, 2006 10:39 am    Post subject: Reply with quote

Like an idiot, only today did I think to try psyco with Portage.

This is on a Pentium-4 laptop with a 4200RPM hard disk and 512MB RAM, from 2002.

For 'emerge -epv world' having been run a few times to load the I/O operations into cache, psyco saves nearly a minute (0'50" versus 1'40"). My world file has 162 entries.

However, most emerge operations are I/O bound since they will only be run once -- I don't expect noticeable performance improvements in regular use. Hopefully Portage 3.0 will have major changes to relieve disk usage ...

vm wrote:
psyco is great but platform-dependent, it doesnt work on PowerPC platforms for example,
AND IF YOURE WRITING A PYTHON CODE,
DONT USE psyco AT ALL !

do that only for test goals but never for anything else


Agreed -- each Python implementation should include its own JIT compilation level, where appropriate.
_________________
Personal overlay | Simple backup scheme
Back to top
View user's profile Send private message
H-Dragon
Guru
Guru


Joined: 22 Oct 2002
Posts: 547

PostPosted: Mon Aug 21, 2006 11:11 am    Post subject: Reply with quote

Code:

#Speedup using PSYCO
try:
        import psyco
        psyco.full()
except ImportError:
        pass
#Speedup using PSYCO

works like a charm
_________________
WEBSITE
Do not meddle with the affairs of Dragons, for you are crunchy and tasty with ketchup!
Back to top
View user's profile Send private message
henri
Apprentice
Apprentice


Joined: 15 Nov 2002
Posts: 182
Location: Germany

PostPosted: Sat Sep 09, 2006 3:23 pm    Post subject: Reply with quote

Hi folks,

first of all, here are my...
Code:
emerge -uDp world
...measure times:

without psyco:
- Run 1: 2m31.900s
- Run 2: 0m26.093s
- Run 3: 0m26.018s

with psyco:
- Run 1: 0m15.628s
- Run 2: 0m15.370s
- Run 3: 0m15.416s

Code:
emerge -s alsa
...measure times:

without psyco:
- Run 1: 0m3.209s
- Run 2: 0m1.734s
- Run 3: 0m1.721s

with psyco:
- Run 1: 0m1.414s
- Run 2: 0m1.413s
- Run 3: 0m1.460s

So using psyco in emerge is really a great idea!


But let me also say a few words about esearch and eupdatedb:

gbu wrote:
Of course you can do the same thing to esearch and eupdatedb.


I tried that, too but doing the same with esearch does NOT lead to a performance boost!

Code:
esearch esearch

without psyco:
- real 0m0.176s

With psyco:
- real 0m0.537s

So you better keep esearch "without" psyco!


What about eupdatedb?
Let's see...

Code:
eupdatedb

without psyco:
- Run 1: 7m3.239s
- Run 2: 6m58.972s
- Run 3: 6m54.535s

with psyco:
- Run 1: 7m1.324s
- Run 2: 6m56.274s
- Run 3: 6m56.139s

I don't think using psyco in eupdatedb does really make sense.
I did remove the psyco lines from updatedb.

But this is really a great hint for emerge!

Many thanks,
yours Henri Schomäcker
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3
Page 3 of 3

 
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