ian o
Posts: 8
Nickname: iano
Registered: Aug, 2007
|
|
Re: Speed of Python
|
Posted: Aug 19, 2007 3:53 AM
|
|
You would need some really special code to see that 700x.
Writing object oriented code in c++ vs inline, c code the works to avoid function call can acutally produce a speed penalty of that order too- but only in extreme and a typical situations.
Fetching each byte of python code and deciding what to do has a performance hit- but how much happens as result will determine how significant the hit. Do a bit shift, which is a very small amount of computer work, and the overhead of python instruction is extreme. Anything which calls the operating or libraries (e.g. graphics manipulation) and the overhead become insignificant.
The heavier the graphics, the less significant the performance penalty. From the sound of it in an application like yours the performance penalty would be less than 20% (1.2) rather than 700x or (70000%). Once the game is working you can at any time transfer any code from python to a c library to target any performance critical code which is evaluated to have a real impact. The end result is you get the game working earlier, and by moving anything that turns out to be performance critical into a binary library (which in all likelyhood is already the case through your graphic libs) you will not notice any performance change in the end.
|
|