yeah...definitely the GIL.
Here are some options for speeding up your calculations
- If your simulations aren't dependent on each other, just run multiple python interpreters.
- Use numpy especially if you're working with matricies
- Use the multiprocessing module
instead of threading. This will allow you to run multiple simulations in parallel.
- Try Scipy.weave
- Rewrite any hotspots in your code using Cython
. You can very easily get some big gains (like orders of magnitude better in some cases)
- Write performance critical parts in C and make them accessible via a dll and then use ctypes to call them.
- Write a full fledged C-extension