I read that people saying something about difference in speed between C++ and Python.
Is this theory right ?
Is there any difference in speed , efficiency or anything in performance between programs written with different languages ?
What i like about Ogre 3D is that it uses C++ as a primary language.
But i still want to know about this theory , is it real ?
speeds of programming languages.
-
xsx
- Kobold
- Posts: 31
- Joined: Tue Jan 20, 2009 10:38 am
- Location: egypt
-
reptor
- Ogre Magi
- Posts: 1120
- Joined: Wed Nov 15, 2006 7:41 pm
- Location: Finland
- x 5
Re: speeds of programming languages.
What theory? 
Of course there is difference.
Of those two Python is the slower one.
Here is a website which might help to estimate which language is fast and which is not:
http://shootout.alioth.debian.org/
But it depends what you want to do with the language whether it is fast-enough or not. The development speed is also important, and with the slower languages you might get better development speed than with the faster ones.
Of course there is difference.
Of those two Python is the slower one.
Here is a website which might help to estimate which language is fast and which is not:
http://shootout.alioth.debian.org/
But it depends what you want to do with the language whether it is fast-enough or not. The development speed is also important, and with the slower languages you might get better development speed than with the faster ones.
- Kojack
- OGRE Moderator

- Posts: 7157
- Joined: Sun Jan 25, 2004 7:35 am
- Location: Brisbane, Australia
- x 538
Re: speeds of programming languages.
The difference between languages isn't theoretical, it can be massive.
Depending on the task and the language, one can be hundreds of times faster than another.
There can also be vast differences in the memory usage of different languages.
Depending on the task and the language, one can be hundreds of times faster than another.
There can also be vast differences in the memory usage of different languages.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: speeds of programming languages.
Dynamically or strongly typed, compiled or interpreted.
Those factors contributes a lot to the relative speediness of languages.
Python-Ogre is an excellent example of using the best features from each group: the speediness of C++ and the flexibility of Python.
Those factors contributes a lot to the relative speediness of languages.
Python-Ogre is an excellent example of using the best features from each group: the speediness of C++ and the flexibility of Python.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
- xadhoom
- Minaton
- Posts: 973
- Joined: Fri Dec 28, 2007 4:35 pm
- Location: Germany
- x 1
Re: speeds of programming languages.
My Prof always preached that a language without type safety is not a programming language, maybe at most a scripting language...
xad
xad
-
bharling
- Gremlin
- Posts: 166
- Joined: Fri Jun 30, 2006 1:04 pm
Re: speeds of programming languages.
I use python pretty much exclusively ( mainly because I'm not good at writing C++ ).
On the plus side, its really very quick to sketch out ideas without having to worry about making everything work the way the system requires. And in some rare cases it can actually be faster than C++, as python allows you to do clever things more easily. I've written things like octrees in python that seem to run faster than the equivalent c++.
The downside is of course that its still interpreted, so there will always be extra overhead as python calls underlying functions from your code, sometimes this overhead can be huge, but in day-to-day use you're unlikely to encounter it too much. Ogre really could not be written in python, but python provides an almost perfect way to control Ogre at a higher level.
I've used python in a lot of commercial projects in my job, and have rarely encountered something that just can't be done, mainly due to the extensive support libraries python provides. I'm also using Python-Ogre currently for prototyping a major project, though the eventual implementation will be C++ based ( and handled by someone with considerably more skill than me, i hope
)
On the plus side, its really very quick to sketch out ideas without having to worry about making everything work the way the system requires. And in some rare cases it can actually be faster than C++, as python allows you to do clever things more easily. I've written things like octrees in python that seem to run faster than the equivalent c++.
The downside is of course that its still interpreted, so there will always be extra overhead as python calls underlying functions from your code, sometimes this overhead can be huge, but in day-to-day use you're unlikely to encounter it too much. Ogre really could not be written in python, but python provides an almost perfect way to control Ogre at a higher level.
I've used python in a lot of commercial projects in my job, and have rarely encountered something that just can't be done, mainly due to the extensive support libraries python provides. I'm also using Python-Ogre currently for prototyping a major project, though the eventual implementation will be C++ based ( and handled by someone with considerably more skill than me, i hope
Was here
- Evak
- Orc Shaman
- Posts: 707
- Joined: Sun Apr 02, 2006 7:51 pm
- Location: Sacramento, CA
- x 1
- Contact:
Re: speeds of programming languages.
Were using blitzmax with ogre in Flow, Bmax being a kind of OO basic/C hybrid . It compiles to C++ and seems pretty fast. Averaged about 2-4% slower than straight c++ in the comparison tests that were done a while back.
- JohnJ
- OGRE Expert User

- Posts: 975
- Joined: Thu Aug 04, 2005 4:14 am
- Location: Santa Clara, California
- x 4
Re: speeds of programming languages.
I've seen you say this a few times, and it confuses me a little about what you mean by "BlitzMax compiles to C++". IIRC, Mark Sibley said that BlitzMax compiles to an assembly language / opcode. Maybe I'm misinterpreting this, but it sounds like you're saying BlitzMax converts the syntax to C++, which it then uses a C++ compiler to compile into an executable. I know that BlitzMax allows you to download and integrate MingW, which you can use to integrate C++ libraries, but I'm 99% sure that BlitzMax is a real compiler and doesn't just "translate" to C++ (otherwise why would it lack so many features C++ has?)Evak wrote:Were using blitzmax with ogre in Flow, Bmax being a kind of OO basic/C hybrid . It compiles to C++ and seems pretty fast. Averaged about 2-4% slower than straight c++ in the comparison tests that were done a while back.
- Evak
- Orc Shaman
- Posts: 707
- Joined: Sun Apr 02, 2006 7:51 pm
- Location: Sacramento, CA
- x 1
- Contact:
Re: speeds of programming languages.
JohnJ, Don't know to be honest. When I described it before on the flow showcase threads I was just trying to explain it in laymans terms for those that didn't know what it was. From what our C++ coder could glean from it, Bmax seems to be a kind of C wrapper with easy to use helper functions compiled with GCC. Whether it uses its own compiler I don't know.
Last edited by Evak on Mon Jan 26, 2009 8:15 pm, edited 1 time in total.
- jacmoe
- OGRE Retired Moderator

- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
- Contact:
Re: speeds of programming languages.
Blitxmax is a compiler, made in C/C++. So, yes: it's C++, but not quite. Because the BM compiler compiles to byte-code (AFAIK). Sort of like the CLR in .NET. 
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.