美文网首页
用Pypy给python加速

用Pypy给python加速

作者: HiWoo | 来源:发表于2019-05-15 16:05 被阅读0次

众所周知, python的运行速度比较慢!
但是, 我们可以使用 Pypy 代替原生的Python解释器运行我们的Python程序提速。据我所知,Pypy对原生Python代码的兼容性还不错.

下面我来测试下循环速度:

import time
st = time.time()
n = 1000*1000*100
while n > 0:
    n-=1
print(time.time()-st)
QQ截图20190515160106.png

原文: https://demo.osroom.com/post?id=5cdbc7ba1d41c87847807fd3

相关文章

网友评论

      本文标题:用Pypy给python加速

      本文链接:https://www.haomeiwen.com/subject/rszpaqtx.html