Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[TIP] psyco, un compilatore JIT per python
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools)
View previous topic :: View next topic  
Author Message
morellik
l33t
l33t


Joined: 03 Feb 2003
Posts: 629
Location: Firenze

PostPosted: Fri Apr 09, 2004 10:47 am    Post subject: [TIP] psyco, un compilatore JIT per python Reply with quote

mod: ho modificato il titolo con qualcosa di più significativo per i posteri -MyZelF

Spero sia l'ultima, ma sono sceso in campo... e l'ho fatto per voi.... [libera trasposizione da Zelig].

Chi usa python e' probabile conosca psyco, per chi non lo conoscesse, in poche
parole, Psyco è + o - un compilatore just-in-time, che permette a programmi scritti in Python di essere eseguiti piu' velocemente.

Che linguaggio usa emerge? Python!! Tadaaaa.... :D
Perche' non provare ad usare psyco con emerge?

Test con emerge senza psyco:
Code:

# time emerge -s xorg
.
real    0m4.915s
user    0m1.796s
sys     0m0.291s

# time emerge -uDva world
.
real    0m17.406s
user    0m12.710s
sys     0m1.997s


Installo psyco:
Code:

# emerge psyco


Aggiungo psyco a emerge:
Code:

# vi /usr/bin/emerge

Code:

#!/usr/bin/python -O
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-src/portage/bin/emerge,v 1.264 2004/02/08 21:24:15 nakano Exp $
                                                                                                                               
import os,sys
os.environ["PORTAGE_CALLER"]="emerge"
sys.path = ["/usr/lib/portage/pym"]+sys.path
                               
### AGGIUNGERE QUESTE LINEE ######                                                                                               
try:
        import psyco
        psyco.full()
except ImportError:
        pass

#####################################

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


Test dopo modifica:

Code:

# time emerge -s xorg
..
real    0m3.743s
user    0m1.466s
sys     0m0.307s

# time emerge -uDva world
..
real    0m12.906s
user    0m9.513s
sys     0m2.006s


Magari non serve a niente... ma chissa'....

Ciauz
morellik
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Fri Apr 09, 2004 10:52 am    Post subject: Reply with quote

TIP Award!!! 8) . Anche questa aggiunta nei post utilissimi.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Fri Apr 09, 2004 10:53 am    Post subject: Re: [non mi uccidete - TIP] Questa non e' male.... Reply with quote

morellik wrote:
Magari non serve a niente... ma chissa'....


Beh c'é un 20-30% di incremento delle prestazioni, il che non é male.

Ma ci sono controindicazioni/incompatibilità nell'uso?
_________________
Ciao da me!
Back to top
View user's profile Send private message
morellik
l33t
l33t


Joined: 03 Feb 2003
Posts: 629
Location: Firenze

PostPosted: Fri Apr 09, 2004 11:13 am    Post subject: Re: [non mi uccidete - TIP] Questa non e' male.... Reply with quote

randomaze wrote:
morellik wrote:
Magari non serve a niente... ma chissa'....


Beh c'é un 20-30% di incremento delle prestazioni, il che non é male.

Ma ci sono controindicazioni/incompatibilità nell'uso?


Non mi pare. Sto attualmente usando emerge con psyco e non mi ha
dato nessun problema.

Ciauz
morellik
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30837
Location: here

PostPosted: Fri Apr 09, 2004 11:18 am    Post subject: Reply with quote

Anche se un ottimo tips per le ricerche preferisco usare esearch.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
FonderiaDigitale
Veteran
Veteran


Joined: 06 Nov 2003
Posts: 1710
Location: Rome, Italy

PostPosted: Fri Apr 09, 2004 3:54 pm    Post subject: Reply with quote

Lo uso gia da 3 mesi e devo dire che va decisamente meglio :)
_________________
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Back to top
View user's profile Send private message
shanghai
Guru
Guru


Joined: 08 Feb 2004
Posts: 493
Location: Roma, Italia, GeekLand

PostPosted: Fri Apr 09, 2004 4:07 pm    Post subject: Reply with quote

Forse però sarebbe il caso di suggerire l'aggiunta di una flag USE "psyco" per tutti i pacchetti basati su python... immaginate il miglioramento?
Mi sa che pure una parte di openoffice è fatta in python: se non è ottimizzata in questo modo... :twisted:
_________________
Il sonno della ragione genera mostri.
Back to top
View user's profile Send private message
tomasino
Apprentice
Apprentice


Joined: 11 Feb 2004
Posts: 154
Location: Italy, Bologna

PostPosted: Tue Apr 13, 2004 2:11 pm    Post subject: Re: [non mi uccidete - TIP] Questa non e' male.... Reply with quote

randomaze wrote:


Ma ci sono controindicazioni/incompatibilità nell'uso?


Interesserà ai meno, ma purtroppo non c'è un porting di Psyco per ppc :(
Back to top
View user's profile Send private message
n3m0
l33t
l33t


Joined: 08 Feb 2004
Posts: 798
Location: Richville, Naples, Italy, Europe

PostPosted: Mon Aug 23, 2004 7:26 am    Post subject: Reply with quote

FonderiaDigitale wrote:
Lo uso gia da 3 mesi e devo dire che va decisamente meglio :)


Ho deciso solo ora di provarlo.
Sono d'accordo, va visibilmente e sensibilmente meglio.
_________________
L’energia è la civiltà. Lasciarla in mano ai piromani/petrolieri è criminale. Perché aspettare che finisca il petrolio?
L’età della pietra non è mica finita per mancanza di pietre. - B.G.


Site/Blog: http://www.neminis.org
Back to top
View user's profile Send private message
Cagnulein
l33t
l33t


Joined: 18 Sep 2003
Posts: 861
Location: Modena, Italy

PostPosted: Mon Aug 23, 2004 9:45 am    Post subject: Reply with quote

provato anche io...cavolo la differenza si vede a occhio!!
Back to top
View user's profile Send private message
n3m0
l33t
l33t


Joined: 08 Feb 2004
Posts: 798
Location: Richville, Naples, Italy, Europe

PostPosted: Sun Oct 24, 2004 11:51 am    Post subject: Reply with quote

SEGNALZIONE: Con l'ultima versione di portage (2.0.51) tale tip provoca un segmentation fault di emerge durante le fasi di merging, unmerging, pretend, etc.

La cosa strana è che dopo il SIGSEGV se si riavvia la stessa operazione, essa va a buon fine o, al limite, riceve un SIGSEGV in punto successivo, dopodichè si stabilizza.
Il mio iter è stato questo:

- lancio una ricerca (emerge -s) ==> SIGSEGV
- rilancio la ricerca ==> OK
- lancio un (un)merge ==> SIGSEGV
- rilancio l'(un)merge ==> OK
- lancio un -uDp ==> SIGSEGV
- rilancio -uDp ==> SIGSEGV in un punto successivo
- rilancio -uDp ==> OK
_________________
L’energia è la civiltà. Lasciarla in mano ai piromani/petrolieri è criminale. Perché aspettare che finisca il petrolio?
L’età della pietra non è mica finita per mancanza di pietre. - B.G.


Site/Blog: http://www.neminis.org
Back to top
View user's profile Send private message
Cazzantonio
Bodhisattva
Bodhisattva


Joined: 20 Mar 2004
Posts: 4514
Location: Somewere around the world

PostPosted: Sun Oct 24, 2004 11:54 am    Post subject: Reply with quote

n3m0 wrote:
SEGNALZIONE: Con l'ultima versione di portage (2.0.51) tale tip provoca un segmentation fault di emerge durante le fasi di merging, unmerging, pretend, etc.


Ancora non ho messo psyco con il portage nuovo ma proverò...
nel frattempo hai fatto un bug report?
_________________
Any mans death diminishes me, because I am involved in Mankinde; and therefore never send to know for whom the bell tolls; It tolls for thee.
-John Donne
Back to top
View user's profile Send private message
n3m0
l33t
l33t


Joined: 08 Feb 2004
Posts: 798
Location: Richville, Naples, Italy, Europe

PostPosted: Sun Oct 24, 2004 12:00 pm    Post subject: Reply with quote

Cazzantonio wrote:
nel frattempo hai fatto un bug report?


Sto andando :wink:

EDIT: fatto.
_________________
L’energia è la civiltà. Lasciarla in mano ai piromani/petrolieri è criminale. Perché aspettare che finisca il petrolio?
L’età della pietra non è mica finita per mancanza di pietre. - B.G.


Site/Blog: http://www.neminis.org
Back to top
View user's profile Send private message
n3m0
l33t
l33t


Joined: 08 Feb 2004
Posts: 798
Location: Richville, Naples, Italy, Europe

PostPosted: Sun Oct 24, 2004 3:12 pm    Post subject: Reply with quote

n3m0 wrote:
Cazzantonio wrote:
nel frattempo hai fatto un bug report?

fatto.


Quote:
You modify portage, it's your fork, it's your bug.


non ha tutti i torti...
_________________
L’energia è la civiltà. Lasciarla in mano ai piromani/petrolieri è criminale. Perché aspettare che finisca il petrolio?
L’età della pietra non è mica finita per mancanza di pietre. - B.G.


Site/Blog: http://www.neminis.org
Back to top
View user's profile Send private message
Cazzantonio
Bodhisattva
Bodhisattva


Joined: 20 Mar 2004
Posts: 4514
Location: Somewere around the world

PostPosted: Sun Oct 24, 2004 5:13 pm    Post subject: Reply with quote

Allora il bug report dovrebbe essre propositivo, del tipo:
"perchè non mettete questa nuova funzionalità in portage?" :)
_________________
Any mans death diminishes me, because I am involved in Mankinde; and therefore never send to know for whom the bell tolls; It tolls for thee.
-John Donne
Back to top
View user's profile Send private message
Rulez
Tux's lil' helper
Tux's lil' helper


Joined: 06 Nov 2004
Posts: 119
Location: Rome

PostPosted: Fri Nov 12, 2004 5:56 pm    Post subject: Reply with quote

a me con questo psyco, è molto + lento ...al posto di questo

Code:

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


ho questo
Code:

import portage


che nn so cosa sia ... :oops: :roll:
_________________
Account jabber: Rulez@jabber.org

:lol: -=[ - Gentoo Power - ]=- :lol:
Back to top
View user's profile Send private message
randomaze
Bodhisattva
Bodhisattva


Joined: 21 Oct 2003
Posts: 9985

PostPosted: Fri Nov 12, 2004 7:07 pm    Post subject: Reply with quote

Rulez wrote:
a me con questo psyco, è molto + lento ...al posto di questo


:?:

Non mi é chiaro se hai messo psyco o meno, comunque con il nuovo portage probabilmente non funziona (almeno, questo é quello che ha scoperto n3m0).
_________________
Ciao da me!
Back to top
View user's profile Send private message
unz
l33t
l33t


Joined: 28 Jul 2004
Posts: 819
Location: Roma, Italia

PostPosted: Wed Dec 08, 2004 12:01 pm    Post subject: Reply with quote

confermo, con l'ultimo portage non va ... segmentazione a go-go .... :(
_________________
Ma che c'hai là? Sulla spalla!!!! http://lascimmia.it/
Back to top
View user's profile Send private message
codadilupo
Advocate
Advocate


Joined: 05 Aug 2003
Posts: 3135

PostPosted: Wed Jan 12, 2005 9:46 pm    Post subject: Reply with quote

stavo rimettendo mano a questo tip, perché non avevo piu' avuto occasione di provarlo: con portage-2.0.51-r3 funziona senza problemi.

Coda
Back to top
View user's profile Send private message
codadilupo
Advocate
Advocate


Joined: 05 Aug 2003
Posts: 3135

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

codadilupo wrote:
stavo rimettendo mano a questo tip, perché non avevo piu' avuto occasione di provarlo: con portage-2.0.51-r3 funziona senza problemi.

Coda


okey, ho detto una cazzata: tutti i problemi che ho avuto qui, erano dovuti a psyco :-(

Coda
Back to top
View user's profile Send private message
xchris
Advocate
Advocate


Joined: 10 Jul 2003
Posts: 2824

PostPosted: Tue Jan 18, 2005 2:14 pm    Post subject: Reply with quote

ai tempi ho avuto problemi anche io con psyco + unclepine
Ho ritoccato il codice per farlo funzionare correttamente.
(perche' modificavo in modo un po' barbaro delle liste e ho idea che i puntatori andavano a ramengo)

peccato che con portage non vada :S
Su unclepine si vede una bella differenza.
Ciao
_________________
while True:Gentoo()
Back to top
View user's profile Send private message
exebeje
n00b
n00b


Joined: 18 Aug 2004
Posts: 38

PostPosted: Tue Jan 18, 2005 5:24 pm    Post subject: Reply with quote

Io ho dovuto modificare con:

import psyco
psyco.full

ebbasta!
Con portage 2.0.51-r2 va, mentre prima segfaultava!
_________________
"just because you're paranoid it don't mean they're not after you"
Back to top
View user's profile Send private message
gamberetto
Apprentice
Apprentice


Joined: 29 Mar 2005
Posts: 210
Location: Camisano Vicentino (VI)

PostPosted: Tue Mar 29, 2005 2:02 pm    Post subject: Reply with quote

exebeje wrote:
Io ho dovuto modificare con:

import psyco
psyco.full

ebbasta!
Con portage 2.0.51-r2 va, mentre prima segfaultava!


anche a me così funziona!
_________________
Andre!
http://www.antimafiaduemila.com
Back to top
View user's profile Send private message
bandreabis
Advocate
Advocate


Joined: 18 Feb 2005
Posts: 2489
Location: イタリアのロディで

PostPosted: Fri Jul 07, 2006 9:39 pm    Post subject: Reply with quote

Niente da fare su amd64.
_________________
Il numero di post non fa di me un esperto! Anzi!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) Risorse italiane (documentazione e tools) 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