在CPython中嵌入PyPy:jitpy

jopen 9年前

jitpy能够在你的CPython中嵌入PyPy,因此你能够从cpython使用限制的接口来调用pypy优化的功能。

from jitpy import setup  setup('<path-to-pypy-home>')  from jitpy.wrapper import jittify    @jittify([int, float], float)  def func(count, no):      s = 0      for i in range(count):         s += no      return s    func(100000, 1.2)

项目主页:http://www.open-open.com/lib/view/home/1418552416386