title: ( How ) does scipy.integrate.odeint accelerate function evaluation?
body: <p>Typically pure python <a href="http://benchmarksgame.alioth.debian.org/u64q/python.php" rel="nofollow">is ~50x slower than native code</a> (C, Fortran) if it consist of tight loop with simple aritmetics. When you use <a href="http://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.odeint.html" rel="nofollow">scipy.odeint</a> like described for example in this <a href="http://wiki.scipy.org/Cookbook/Zombie_Apocalypse_ODEINT" rel="nofollow">tutorial</a> you just write functions do integrate in pure python like this:</p>
  
  <pre><code>def f(y, t):
         Si = y[0]
         Zi = y[1]
         Ri = y[2]
         # the model equations (see Munz et al. 2009)
         f0 = P - B*Si*Zi - d*Si
         f1 = B*Si*Zi + G*Ri - A*Si*Zi
         f2 = d*Si + A*Si*Zi - G*Ri
         return [f0, f1, f2]
  </code></pre>
  
  <p>This function has to be evaluated manytimes, so I would expect that it would make a huge performace bottleneck, considering that the odeint integrator itself is made in FORTRAN/ODPACK</p>
  
  <p><strong>Does it use something to convert the function <code>f(y,t)</code> from python to native code?</strong>
  (like f2py, scipy.weave, cython ...) As far as I know, odeint does not need any C/C++ or Fortran compiler, and it does not increase the initialization time of my python script, so probably f2py and scipy.weave is not used.</p>
  
  <p>I'm asking that question, because, maybe, it would be good idea to use the same approach as scipy.integrate.odeint use for acceleration of tight loops in my own code. Using odeint is even more convenient than using f2py or scipy.weave.</p>