Return to Snippet

Revision: 10299
at December 16, 2008 23:55 by tamuratetsuya

Initial Code
If you need to speed up your Python program there are several possible approaches, with varying degree of effort needed, here is (probably not complete) overview:

   1. Rewrite your Python code by parallelizing or optimizing/replacing/tuning algorithm(s), e.g. using: 
          * Hadoop or Disco
                o Open source implementations of MapReduce 
          * Parallel Python 
          * Message Passing Interface (MPI)
                o Frequently used for numerical programming
          * Bulk Synchronous Parallel (BSP) 
          * RPyC
                o RPC for Distributed/Parallel Programming
          * Twisted
                o Network libraries for Distributed/Parallel Programming
          * Profiling Tools
          * Threading or Microthreads (Stackless) 
   2. Use a tool that can speed up your code more or less unchanged
          * Psyco
                o Just in time compiler, note: this is probably the easiest approach to try
          * Pyrex
                o Write and compile Python with a flavor of C data structures
          * Cython 
          * PyJs 
                o Compile (large subset of) Python to Javascript, note: probably more interesting for client development (ajax) than server side.
          * Rpython
                o Compile (large subset of) Python to native code, note: part of PyPy project
          * PyStream
          * GPULib
          * Shedskin 
                o Compile (large subset of) Python to C++, some benchmarks
   3. Replace (parts of) your Python code with another language
          * Simplified Wrapper and Interface Generator (SWIG) 
                o Use C/C++ from Python
          * Fortran to Python Interface Generator (F2PY) 
                o Use Fortran from Python
          * llvm-py 
                o Code and Compile to Assembler for running on Low-Level Virtual Machine
          * CorePy 
                o Write Assembly Code in Python
          * Weave 
          * PyInline 
          * Boost.Python
          * Cinpy 
                o C code blended with Python (using ctypes) and runtime compilation with tcc

Initial URL

Initial Description

Initial Title
Tools for Accelerating Python

Initial Tags

Initial Language