472,780 Members | 1,792 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,780 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 2180
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.