Just a short note to let you know that this post has become outdated because MongoDB supports native two dimensional geospatial indexing. More information can be found here.
2 Possible Ways To Speed Up NetworkX (and Python)
I'm in the process of looking for a way to run the shortest path algorithms of NetworkX in a faster way. At this moment I tried psyco and PyPy.
Psyco
Using psyco is really easy. After installing it you only have to write the following two lines.
import psyco
psyco.full()
Psyco didn't speedup my shortest path calculations.
If you want to know more about psyco I suggest you to read the documentation.
PyPy
In order to test PyPy I downloaded the latest windows binary and ran my code against PyPy instead of CPython by invoking my script on the command line with pypy.exe.
The startup time is a lot longer for PyPy but if you don't take this startup cost into account then the speedup on my machine is in the range of 10-20% for shortest path routing with NetworkX.
So far my tests. Any suggestions ?