473,327 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

psyco out of memory

I have this simple *dumb* benchmark-like program:

#import psyco
#psyco.full()

d = 0.0
for i in xrange(1000000000):
d += i
print d

I though I'd use it to try out psyco, but no, when I enable the first
two lines, python core-dumps:

Fatal Python error: psyco: out of memory
Abort (core dumped)

Now this isn't a real-world application example, but it's certainly
unexpected. Did psyco try to mimic range() and allocate 1G of integers?

(I'm running python 2.3.4 on FreeBSD 5)

--
What part of "Ph'nglui mglw'nath Cthulhu R'lyeh wgah'nagl fhtagn" don't
you understand?
Jul 18 '05 #1
7 2198
Ivan Voras <ivoras@__geri.cc.fer.hr> writes:
I have this simple *dumb* benchmark-like program:

#import psyco
#psyco.full()

d = 0.0
for i in xrange(1000000000):
d += i
print d

I though I'd use it to try out psyco, but no, when I enable the first
two lines, python core-dumps:

Fatal Python error: psyco: out of memory
Abort (core dumped)


Hum. Are you using the ivm or the x86 backend?

Also, you might have better luck just using range()...

Cheers,
mwh

--
... but I guess there are some things that are so gross you just have
to forget, or it'll destroy something within you. perl is the first
such thing I have known. -- Erik Naggum, comp.lang.lisp
Jul 18 '05 #2
Michael Hudson wrote:
Fatal Python error: psyco: out of memory
Abort (core dumped)

Hum. Are you using the ivm or the x86 backend?


Don't know. How do I tell?
Also, you might have better luck just using range()...


Tried it. Same thing.

--
What part of "Ph'nglui mglw'nath Cthulhu R'lyeh wgah'nagl fhtagn" don't
you understand?
Jul 18 '05 #3
Ivan Voras wrote:
(I'm running python 2.3.4 on FreeBSD 5)


Hmph. I tried on WinXP and it works. Maybe it's a platform-specific bug.

(Still, I'm surprised how slow it is. The same "program" in Java takes
about 10sec, and here it's passed 5 minutes and I'm still waiting...)

--
What part of "Ph'nglui mglw'nath Cthulhu R'lyeh wgah'nagl fhtagn" don't
you understand?
Jul 18 '05 #4
Ivan Voras wrote:
Ivan Voras wrote:
(I'm running python 2.3.4 on FreeBSD 5)

Hmph. I tried on WinXP and it works. Maybe it's a platform-specific bug.

(Still, I'm surprised how slow it is. The same "program" in Java takes
about 10sec, and here it's passed 5 minutes and I'm still waiting...)


I believe that psyco only accelerates functions and methods. So, it's
not going to do anything in the case you presented. This makes it
particularly suprising that it broke. Try wrapping up your loop in a
function. And with Psyco range is (or at least used to be) better. Like so:

import psyco

def f():
d = 0.0
for i in range(1000000000):
d += i
print d
psyco.bind(f)

f()

That ran in about a minute here. Psyco won't speed up floating point
operations near as much as integer ops at present, hence its speed
deficit with respect to java.

-tim

Jul 18 '05 #5
Michael Hudson wrote:
Ivan Voras <ivoras@__geri.cc.fer.hr> writes:

I have this simple *dumb* benchmark-like program:

#import psyco
It crashes here, right?

I think I know this problem. Armin submitted
a patch concerning memory mapping. Upgrading to
the current cvs version and building by hand should help.
#psyco.full()

d = 0.0
for i in xrange(1000000000):
d += i
print d
You need to wrap this into a function, or you will
not get accelerated.
I though I'd use it to try out psyco, but no, when I enable the first
two lines, python core-dumps:

Fatal Python error: psyco: out of memory
Abort (core dumped)

Hum. Are you using the ivm or the x86 backend?

Also, you might have better luck just using range()...


No, there is no difference using range or xrange, but the
fact that your machine will blow up if Psyco is not in
place and you try to build a range that huge. That's why
I prefer xrange.

ciao - chris
p.s.:
Btw. there has been a bug in Psyco which made the xrange
case slower when using Psyco with Stackless. No Stackless bug,
simply the case that I do a PyType_Ready() on xrange which
standard Python dowsn't, and that inserts a defaul init
function that Psyco did not support (until Wednesday)

--
Christian Tismer :^) <mailto:ti****@stackless.com>
Mission Impossible 5oftware : Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a : *Starship* http://starship.python.net/
14109 Berlin : PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34 home +49 30 802 86 56 mobile +49 173 24 18 776
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today? http://www.stackless.com/

Jul 18 '05 #6
Christian Tismer wrote:
Michael Hudson wrote:
Ivan Voras <ivoras@__geri.cc.fer.hr> writes:

I have this simple *dumb* benchmark-like program:

#import psyco

It crashes here, right?


yes.

--
What part of "Ph'nglui mglw'nath Cthulhu R'lyeh wgah'nagl fhtagn" don't
you understand?
Jul 18 '05 #7
Tim Hochberg wrote:
(Still, I'm surprised how slow it is. The same "program" in Java takes
about 10sec, and here it's passed 5 minutes and I'm still waiting...)


That ran in about a minute here. Psyco won't speed up floating point
operations near as much as integer ops at present, hence its speed
deficit with respect to java.


Yes, it took about minute here too. While it is a ~ 30x speed gain, it
shows there's still space for improvement :)

--
What part of "Ph'nglui mglw'nath Cthulhu R'lyeh wgah'nagl fhtagn" don't
you understand?
Jul 18 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: KefX | last post by:
Hey...as for what I'm doing with Python, look at my post "Strange Hotshot problem". To make a long story short, I'm embedding Python in order to write a plugin to a freeware music program; the...
10
by: William S. Perrin | last post by:
I'm a python rookie, anyone have and suggestions to streamline this function? Thanks in advance..... def getdata(myurl): sock = urllib.urlopen(myurl) xmlSrc = sock.read() sock.close() ...
0
by: Jeremy Sanders | last post by:
Hi - I'm trying to build a Psyco rpm on Fedora 1. I try the command xpc5:~/psyco-1.1.1> python setup.py bdist_rpm this fails with: .... copying dist/psyco-1.1.1.tar.gz ->...
3
by: Han Benjamin | last post by:
Is anyone aware of any effort in bringing Psyco onto other platforms, esp. PowerPC (Mac OS X)? I checked the website but it's still stated as X86 only. Thanks, Ben
4
by: Roy Smith | last post by:
I understand that psyco significantly increases memory use. Is that for code or data? More specifically, if I've got a memory intensive application (it might use 100's of Mbytes of data), should...
3
by: Dick Moores | last post by:
psyco is acting a bit psycho for me. Please see my spinForWeb.py at <http://www.rcblue.com/Python/spinForWeb.py> When psyco is in use, entering an integer somewhere between 2000 and 2500...
5
by: Fausto Arinos Barbuto | last post by:
Hi All; I have Psyco (on Windows XP) and now I want to install it on Linux, too. I FTP'd the tarball (tar.gz) from Psyco's site but can't get it compiled. First, I tried the usual "python...
6
by: danmcleran | last post by:
I'm not seeing much benefit from psyco (only 5-10% faster). Maybe this example is too trivial? Can someone give me some pointers as to what kind of code would see a dramatic benefit? Here's the...
3
by: a | last post by:
hi i tried psyco+webpy here is the error that i got please let me know if any of you has success run psyco+webpy thanks import web, psyco urls = ( '/', 'view', '/add','add'
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.