pyirrlicht - python ctypes binding

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki

Postby _maxim_ » Fri Jun 17, 2011 7:43 am

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.
_maxim_
 
Posts: 54
Joined: Thu May 27, 2010 11:05 am
Location: Russia

Postby roxaz » Fri Jun 17, 2011 12:03 pm

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
roxaz
 
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Postby _maxim_ » Sat Jun 18, 2011 5:25 am

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.
_maxim_
 
Posts: 54
Joined: Thu May 27, 2010 11:05 am
Location: Russia

Postby roxaz » Sat Jun 18, 2011 8:17 am

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/
roxaz
 
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Postby _maxim_ » Tue Jun 21, 2011 6:31 am

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.
_maxim_
 
Posts: 54
Joined: Thu May 27, 2010 11:05 am
Location: Russia

Re: pyirrlicht - python ctypes binding

Postby _maxim_ » Thu Dec 20, 2012 8:14 pm

_maxim_
 
Posts: 54
Joined: Thu May 27, 2010 11:05 am
Location: Russia

Re: pyirrlicht - python ctypes binding

Postby _maxim_ » Sat Jan 19, 2013 6:28 am

next edition game builder
some bugs fixed
added animations, destroy objects
_maxim_
 
Posts: 54
Joined: Thu May 27, 2010 11:05 am
Location: Russia

Re: pyirrlicht - python ctypes binding

Postby _maxim_ » Thu Feb 21, 2013 5:22 pm

game builder 0.5
added C++ game source
_maxim_
 
Posts: 54
Joined: Thu May 27, 2010 11:05 am
Location: Russia

Re: pyirrlicht - python ctypes binding

Postby _maxim_ » Fri Mar 21, 2014 9:29 pm

http://shanto.ru/gb/en/gb_faq.html - small FAQ for Game Builder
_maxim_
 
Posts: 54
Joined: Thu May 27, 2010 11:05 am
Location: Russia

Re: pyirrlicht - python ctypes binding

Postby superpws » Sat May 10, 2014 9:49 am

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.
IRC: #irrlicht on irc.freenode.net
Github: https://github.com/danyalzia
Homepage: http://danyalzia.com
superpws
 
Posts: 18
Joined: Mon Mar 31, 2014 6:47 am

Re: pyirrlicht - python ctypes binding

Postby _maxim_ » Sat May 10, 2014 6:12 pm

please see your private messages
_maxim_
 
Posts: 54
Joined: Thu May 27, 2010 11:05 am
Location: Russia

Re: pyirrlicht - python ctypes binding

Postby roxaz » Sat Jun 14, 2014 9:08 am

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
roxaz
 
Posts: 575
Joined: Tue Jan 23, 2007 8:35 pm
Location: LT

Previous

Return to Project Announcements

Who is online

Users browsing this forum: No registered users and 1 guest

cron