I made a simple speed test .blend file to test & find a best way to design & optimize my code.
So far IPO is the fastest method, but unfortunately I can’t use it in this way in run-time/.exe
“”"
BGE CODE SPEED TEST
Calculating the CL values with 0.0001 degrees AOA step. 1800000 calculations
Move cursor to on 3D view.
Start the test by hiting the P-key.
wait until the ‘OBCube.tt’ shows the result.
Test PC
Operating System: Windows XP Home Edition SP3
Processor: Intel® Core™2 Quad CPU Q9300 @ 2.50GHz (4 CPUs)
Memory: 3328MB RAM
Page File: 586MB used, 4624MB available
For computationally heavy operations you might consider developing a C library with a python interface, you can make it portable enough to run in all platforms blender runs on and include it with your packaged game. Just an idea…
How did you get the time each script took to run? Using the python time module? Is that an efficient way to benchmark code? I would like to test which parts of my code is heavier but I’m not sure what’s the best way to procede :S
Ah, I see. Yes, the module Blender is not available in runtime.
For what do you need that 1800000 pre-calculated data elements?
Maybe it is better to explain what you want to achive. There are usually multiple solutions.