Recently I've been looking at Povray, pyprocessing, and cfdg (version 3.0) as tools for creating digital images. I have branched two separate blogs where I mainly explore jruby + processing and processing.py

Friday, 6 April 2012

Using pypy to run pyprocessing sketches

Over on the pyprocessing discussion group, I posted my experience of fairly slow rendering of the menger in my previous post. I did not really expect a reply, as it was really only a part excuse for my creating an export to PovRAY. However Flavio Coelho, put me on to trying out pypy, which did lead to quite an improved performance. What I did on my linux box (64bit aptosid distro):-
  1.  I downloaded the 64 bit binary, as superuser I extracted it to the /opt folder, I used update-alternatives to create a symbolic link to /usr/local/bin/pypy 
  2. I reinstalled pyglet using pypy I reinstalled pyprocessing using pypy
  3.  I ran my sketches using pypy with much improvement.
 However I am sure an even greater performance improvement could be achieve if I used GLSL shaders with pyglet (this is the way vanilla processing is headed), but I think I will leave that to the pyprocessing developers. In the meanwhile I had already re-factored my menger2.py sketch to use a Box class (a generalization of cube), with the mesh logic extracted to a new Mesh class. This should reduce the memory usage somewhat as the instance of Box should be garbage collected, on translation to mesh? I use my Aptosid installation as a test bed, else I would not have so happily installed pypy on ubuntu where I do most of my development using Eric5 as my ide (requires python-3.2+).

Update 7 April 2012 some numbers for running menger2.py on my linux box:-

  1. on Apstosid using pypy 1.066 fps (min size 20) 
  2. on Ubuntu using python 0.142 fps (min size 20)
Quite an improvement I will have to say, on aptosid, started off slower 0.8fps and speeded up. ubuntu was painful (down to cpython).

No comments:

Post a Comment

Followers

Blog Archive

About Me

My photo
Pembrokeshire, United Kingdom
I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2