   which is faster
  hi, i am developing my own engine that is named D-Engine, this is  a cross platform engine which is support unicode and use opengl,openal,cegui and internal AImy question:fastest scripting language ( lua,c script or phyton)?i want to use scripts in my materials,particle systems and AI? which scripting language is enoght fast?! ( for supporting particle systems)   
Quote:Original post by Pooya65( for supporting particle systems)You should be doing that in your native language (for speed) and then export manipulation of the system to the scripting language. Don't implement speed-intensive algorithms in the scripting language.On subject, I can't comment as to which one is faster.;  As Halifax has mentioned, you usually don't want to implement tight loops in a scripting language, because they just aren't going to be as fast as native code.That rules out particle updates, but scripting is still perfect to set material and particle system parameters. I would recommend you go with whichever is easiest to implement/use (probably lua, out of that list).   ;Quote:Original post by swiftcoderAs Halifax has mentioned, you usually don't want to implement tight loops in a scripting language, because they just aren't going to be as fast as native code.It doesn't have to be slow.;  I never knew that Lua did vector operations. What are the profile timings between that and the native C/C++ approach?   ;Quote:Original post by SneftelQuote:Original post by swiftcoderAs Halifax has mentioned, you usually don't want to implement tight loops in a scripting language, because they just aren't going to be as fast as native code.It doesn't have to be slow.Fair enough, and I have also managed to reach C-like speeds in Python for floating-point operations in tight loops through ctypes-monkeying. However, I would ague that a std::valarray solution implementing your improved particle update code should beat both of them...   ;Quote:Original post by Halifax2I never knew that Lua did vector operations.It doesn't out of the box, but they're mostly-trivial to add.   ;  Ah okay, fair enough.   ;Quote:Original post by SneftelQuote:Original post by Halifax2I never knew that Lua did vector operations.It doesn't out of the box, but they're mostly-trivial to add.Actually, I am curious how this type of parallel update affects cache coherency, and subsequently performance? If I have a particle system of 10,000 particles, each 32 bytes in size, then a standard loop update ought to keep the cache fed, while the parallel update with traverse the entire array multiple times.   ;  It would depend on whether your particles were SoA or AoS. For the size of particle systems that one generally sees, I doubt it would make much of a difference either way.   