Page 4 of 4

Posted: Fri Jun 17, 2011 7:43 am
by _maxim_
I have already received such criticism a month ago here http://sourceforge.net/projects/pir/for ... ic/4526104 and I repeat my answer here: I totally agree with her. The only question is who can do the job quickly? I do not have enough time now to do so, perhaps in future something will change.

Regarding C++ parser: it always exists in the project, h2ctypes.py (C++ -> py helper generator), h2bi.py (FreeBASIC wraper generator).

Regarding the PyPy: the results of my tests
Collision.py and ctypes version pyirrlicht
Intel Pentium Dual-Core CPU T4300 2.1GHz (without SSE2, if I understand correctly)
Windows 7 64-bit

pypy-1.5.0a0-win32: FPS 55-125; memory usage ~70mb
Python 2.6.6: FPS 145-175; memory usage ~20mb

Not compatibility with official ctypes module, not understand ctypes constructions and always give me this message "RuntimeWarning: C function without declared return type called".
PyPy have very big size, libpypy.dll - 23 424 000 bytes.

It would be interesting to see the results of tests with a CPU with SSE2.

Posted: Fri Jun 17, 2011 12:03 pm
by roxaz
yep, it consumes more memory - a tradeoff for better performance. There is some benchmark data for you:

using benchmark from http://blog.dhananjaynene.com/2008/07/p ... by-groovy/

(data from that site)
c++: 3 microseconds per iteration
CPython 2.5.1: 192 microseconds per iteration
CPython 2.5.1 with psyco: 33 microseconds per iteration

(my own tests)
CPython 2.6: 142 microseconds per iteration
PyPy: 5 microseconds per iteration

pretty good increase in performance i should say.

I didnt notice parser, thanks for info. ill try playing with it in my spare time

Posted: Sat Jun 18, 2011 5:25 am
by _maxim_
With psyco must be very careful, sometimes it has the opposite effect. If you want the accelerator, look at http://code.google.com/p/shedskin/. I think the maximum speed will be with your own Python to C++ helper converter.

Posted: Sat Jun 18, 2011 8:17 am
by roxaz
i put in psyco just as an example, its not maintained any more and developer joined pypy. thing with shedskin is that it does not allow to use full power of python, where pypy does allow that. also pypy has its own shedskin-like translator that can compile rpython (restricted python, rules much like of shedskin) apps to native executables. if interested you can read http://www.rfk.id.au/blog/entry/compili ... -programs/

Posted: Tue Jun 21, 2011 6:31 am
by _maxim_
roxaz wrote:thing with shedskin is that it does not allow to use full power of python, where pypy does allow that.
if there is something lacking, you can always add the necessary, as this is an open source project.
roxaz wrote:also pypy has its own shedskin-like translator that can compile rpython (restricted python, rules much like of shedskin) apps to native executables. if interested you can read http://www.rfk.id.au/blog/entry/compili ... -programs/
Thanks, but I'm more interested in my own pyirrlicht to Irrlicht C++ helper converter.

Re: pyirrlicht - python ctypes binding

Posted: Thu Dec 20, 2012 8:14 pm
by _maxim_

Re: pyirrlicht - python ctypes binding

Posted: Sat Jan 19, 2013 6:28 am
by _maxim_
next edition game builder
some bugs fixed
added animations, destroy objects

Re: pyirrlicht - python ctypes binding

Posted: Thu Feb 21, 2013 5:22 pm
by _maxim_
game builder 0.5
added C++ game source

Re: pyirrlicht - python ctypes binding

Posted: Fri Mar 21, 2014 9:29 pm
by _maxim_
http://shanto.ru/gb/en/gb_faq.html - small FAQ for Game Builder

Re: pyirrlicht - python ctypes binding

Posted: Sat May 10, 2014 9:49 am
by superpws
Have you tried Cython for binding C++ classes? I noticed it's faster and more maintainable. I was actually thinking of making Python wrapper using Cython from scratch. Let me know if you are interested.

Re: pyirrlicht - python ctypes binding

Posted: Sat May 10, 2014 6:12 pm
by _maxim_
please see your private messages

Re: pyirrlicht - python ctypes binding

Posted: Sat Jun 14, 2014 9:08 am
by roxaz
wrapping entire lib manually will take forever. maybe you should look at shiboken. it is wrapper generator for PySide (python wrapper for Qt). Now Qt is big and complex lib meaning that shiboken works. i pastebin'ed my little experiment that generates some wrappers. did not get to building ant testing yet though.
http://pastebin.com/0mT15hJs
http://pastebin.com/XAY6d3XH