{"id":16211,"date":"2024-10-10T20:09:25","date_gmt":"2024-10-10T16:39:25","guid":{"rendered":"https:\/\/www.itpiran.net\/blog\/?p=16211"},"modified":"2024-10-10T20:09:25","modified_gmt":"2024-10-10T16:39:25","slug":"getting-started-with-pypy","status":"publish","type":"post","link":"https:\/\/www.itpiran.net\/blog\/zh\/tutorials\/getting-started-with-pypy\/","title":{"rendered":"PyPy\u5165\u95e8"},"content":{"rendered":"<h2 id=\"%d9%85%d9%82%d8%af%d9%85%d9%87\">\u4ecb\u7ecd<\/h2>\n<p>Python\u7f16\u7a0b\u8bed\u8a00\u662f\u4e00\u4e2a\u63a5\u53e3\uff0c\u53ef\u4ee5\u7528\u591a\u79cd\u4e0d\u540c\u7684\u65b9\u5f0f\u5b9e\u73b0\u3002\u4f8b\u5982\uff0cCPython\u4f7f\u7528C\u8bed\u8a00\u5b9e\u73b0\uff0cJython\u4f7f\u7528Java\u5b9e\u73b0\u7b49\u7b49\u3002.<\/p>\n<p>\u5c3d\u7ba1 CPython \u662f\u6700\u6d41\u884c\u7684 Python \u5b9e\u73b0\uff0c\u4f46\u5b83\u7684\u901f\u5ea6\u5e76\u975e\u6700\u5feb\u3002PyPy \u662f\u53e6\u4e00\u79cd\u517c\u5bb9\u4e14\u901f\u5ea6\u5f88\u5feb\u7684 Python \u5b9e\u73b0\u3002PyPy \u4f9d\u8d56\u4e8e\u5373\u65f6\u7f16\u8bd1 (JIT)\uff0c\u8fd9\u53ef\u4ee5\u663e\u8457\u7f29\u77ed\u957f\u65f6\u95f4\u8fd0\u884c\u64cd\u4f5c\u7684\u6267\u884c\u65f6\u95f4\u3002.<\/p>\n<p>\u672c\u6559\u7a0b\u5c06\u4e3a\u521d\u5b66\u8005\u4ecb\u7ecd PyPy\uff0c\u5e76\u91cd\u70b9\u4ecb\u7ecd\u5b83\u4e0e CPython \u7684\u533a\u522b\u3002\u6211\u4eec\u8fd8\u5c06\u8ba8\u8bba\u5b83\u7684\u4f18\u52bf\u548c\u5c40\u9650\u6027\u3002\u7136\u540e\uff0c\u6211\u4eec\u5c06\u4e86\u89e3\u5982\u4f55\u4e0b\u8f7d\u548c\u4f7f\u7528 PyPy \u6765\u8fd0\u884c\u4e00\u4e2a\u7b80\u5355\u7684 Python \u811a\u672c\u3002.<\/p>\n<p>\u5177\u4f53\u800c\u8a00\uff0c\u672c\u6b21\u57f9\u8bad\u6db5\u76d6\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<ul>\n<li>CPython \u7b80\u4ecb<\/li>\n<li>PyPy\u53ca\u5176\u7279\u6027\u7b80\u4ecb<\/li>\n<li>PyPy \u7684\u5c40\u9650\u6027<\/li>\n<li>\u5728 Ubuntu \u4e0a\u8fd0\u884c PyPy<\/li>\n<li>PyPy \u4e0e CPython \u8fd0\u884c\u65f6\u5bf9\u6bd4<\/li>\n<\/ul>\n<h2 id=\"%d9%85%d8%b1%d9%88%d8%b1%db%8c-%d8%b3%d8%b1%db%8c%d8%b9-%d8%a8%d8%b1-cpython\">CPython \u7b80\u4ecb<\/h2>\n<p>\u5728\u8ba8\u8bba PyPy \u4e4b\u524d\uff0c\u4e86\u89e3 CPython \u7684\u5de5\u4f5c\u539f\u7406\u81f3\u5173\u91cd\u8981\u3002\u4e0b\u56fe\u5c55\u793a\u4e86\u4f7f\u7528 CPython \u5b9e\u73b0\u7684 Python \u811a\u672c\u7684\u6267\u884c\u6d41\u7a0b\u3002.<\/p>\n<p><img  loading=\"lazy\"  decoding=\"async\"  src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAP+KeNJXAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=\"  alt=\"\"  width=\"1405\"  height=\"1595\"  class=\"aligncenter wp-image-16214 size-full pk-lazyload\"  data-pk-sizes=\"auto\"  data-ls-sizes=\"auto, (max-width: 1405px) 100vw, 1405px\"  data-pk-src=\"https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1.png\"  data-pk-srcset=\"https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1.png 1405w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-264x300.png 264w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-902x1024.png 902w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-768x872.png 768w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-1353x1536.png 1353w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-110x125.png 110w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-200x227.png 200w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-380x431.png 380w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-255x289.png 255w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-300x341.png 300w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-550x624.png 550w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-800x908.png 800w, https:\/\/cdn.itpiran.net\/2024\/10\/10195645\/1-1160x1317.png 1160w\" ><\/p>\n<p>\u7ed9\u5b9a\u4e00\u4e2a Python \u811a\u672c\u6587\u4ef6 .py\uff0c\u9996\u5148\u4f7f\u7528 CPython \u7f16\u8bd1\u5668\u5c06\u6e90\u4ee3\u7801\u7f16\u8bd1\u6210\u5b57\u8282\u7801\u3002\u751f\u6210\u7684\u5b57\u8282\u7801\u5b58\u50a8\u5728\u6269\u5c55\u540d\u4e3a .pyc \u7684\u6587\u4ef6\u4e2d\u3002\u7136\u540e\uff0c\u4f7f\u7528 CPython \u89e3\u91ca\u5668\u5728\u865a\u62df\u73af\u5883\u4e2d\u6267\u884c\u8be5\u5b57\u8282\u7801\u3002.<\/p>\n<p>\u4f7f\u7528\u7f16\u8bd1\u5668\u5c06\u6e90\u4ee3\u7801\u8f6c\u6362\u4e3a\u5b57\u8282\u7801\u6709\u5f88\u591a\u4f18\u52bf\u3002\u5982\u679c\u4e0d\u4f7f\u7528\u7f16\u8bd1\u5668\uff0c\u89e3\u91ca\u5668\u4f1a\u76f4\u63a5\u5904\u7406\u6e90\u4ee3\u7801\uff0c\u9010\u884c\u5c06\u5176\u7ffb\u8bd1\u6210\u673a\u5668\u4ee3\u7801\u3002\u8fd9\u6837\u505a\u7684\u7f3a\u70b9\u662f\uff0c\u5c06\u6bcf\u4e00\u884c\u6e90\u4ee3\u7801\u7ffb\u8bd1\u6210\u673a\u5668\u4ee3\u7801\u90fd\u9700\u8981\u6267\u884c\u4e00\u4e9b\u5904\u7406\u8fc7\u7a0b\uff0c\u800c\u4e14\u8fd9\u4e9b\u8fc7\u7a0b\u4f1a\u9488\u5bf9\u6bcf\u4e00\u884c\u91cd\u590d\u6267\u884c\u3002\u4f8b\u5982\uff0c\u8bed\u6cd5\u5206\u6790\u662f\u72ec\u7acb\u4e8e\u5176\u4ed6\u884c\u5bf9\u6bcf\u4e00\u884c\u8fdb\u884c\u7684\uff0c\u56e0\u6b64\u89e3\u91ca\u5668\u4f1a\u82b1\u8d39\u5927\u91cf\u65f6\u95f4\u6765\u7ffb\u8bd1\u4ee3\u7801\u3002\u7f16\u8bd1\u5668\u89e3\u51b3\u4e86\u8fd9\u4e2a\u95ee\u9898\uff0c\u56e0\u4e3a\u5b83\u80fd\u591f\u4e00\u6b21\u6027\u5904\u7406\u6240\u6709\u4ee3\u7801\uff0c\u56e0\u6b64\u8bed\u6cd5\u5206\u6790\u53ea\u9700\u6267\u884c\u4e00\u6b21\uff0c\u800c\u4e0d\u662f\u9488\u5bf9\u6bcf\u4e00\u884c\u4ee3\u7801\u3002\u6240\u4ee5\uff0c\u7f16\u8bd1\u5668\u751f\u6210\u7684\u5b57\u8282\u7801\u66f4\u5bb9\u6613\u89e3\u91ca\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u7f16\u8bd1\u6574\u4e2a\u6e90\u4ee3\u7801\u53ef\u80fd\u5e76\u975e\u5fc5\u8981\uff0c\u6211\u4eec\u5c06\u5728\u8ba8\u8bba PyPy \u65f6\u770b\u5230\u4e00\u4e2a\u6e05\u6670\u7684\u4f8b\u5b50\u3002.<\/p>\n<p>\u5b57\u8282\u7801\u751f\u6210\u540e\uff0c\u7531\u8fd0\u884c\u5728\u865a\u62df\u673a\u4e2d\u7684\u89e3\u91ca\u5668\u6267\u884c\u3002\u865a\u62df\u73af\u5883\u7684\u4f18\u52bf\u5728\u4e8e\u5b83\u5c06 CPython \u5b57\u8282\u7801\u4e0e\u673a\u5668\u89e3\u8026\uff0c\u4ece\u800c\u4f7f Python \u6210\u4e3a\u8de8\u5e73\u53f0\u7a0b\u5e8f\u3002.<\/p>\n<p>\u9057\u61be\u7684\u662f\uff0c\u4ec5\u4ec5\u4f7f\u7528\u7f16\u8bd1\u5668\u751f\u6210\u5b57\u8282\u7801\u5e76\u4e0d\u8db3\u4ee5\u52a0\u901f CPython \u7684\u6267\u884c\u3002\u89e3\u91ca\u5668\u7684\u5de5\u4f5c\u539f\u7406\u662f\u6bcf\u6b21\u6267\u884c\u65f6\u90fd\u5c06\u4ee3\u7801\u7ffb\u8bd1\u6210\u673a\u5668\u7801\u3002\u56e0\u6b64\uff0c\u5982\u679c\u4e00\u884c\u4ee3\u7801\u6267\u884c\u9700\u8981 LX \u79d2\uff0c\u90a3\u4e48\u6267\u884c 10 \u6b21\u5c31\u9700\u8981 X * 10 \u79d2\u3002\u5bf9\u4e8e\u8017\u65f6\u8f83\u957f\u7684\u64cd\u4f5c\u6765\u8bf4\uff0c\u8fd9\u4f1a\u9020\u6210\u975e\u5e38\u5927\u7684\u6267\u884c\u65f6\u95f4\u5f00\u9500\u3002.<\/p>\n<p>\u57fa\u4e8e CPython \u7684 bug\uff0c\u73b0\u5728\u8ba9\u6211\u4eec\u6765\u770b\u770b PyPy\u3002.<\/p>\n<h2 id=\"%d9%85%d9%82%d8%af%d9%85%d9%87-%d8%a7%db%8c-%d8%a8%d8%b1-pypy-%d9%88-%d9%88%db%8c%da%98%da%af%db%8c-%d9%87%d8%a7%db%8c-%d8%a2%d9%86\">PyPy\u53ca\u5176\u7279\u6027\u7b80\u4ecb<\/h2>\n<p>PyPy \u662f\u4e00\u4e2a\u7c7b\u4f3c\u4e8e CPython \u7684 Python \u5b9e\u73b0\uff0c\u5b83\u65e2\u517c\u5bb9\u53c8\u5feb\u901f\u3002\u201c\u517c\u5bb9\u201d\u610f\u5473\u7740 PyPy \u4e0e CPython \u517c\u5bb9\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u4f60\u53ef\u4ee5\u5728 PyPy \u4e2d\u4f7f\u7528\u51e0\u4e4e\u6240\u6709 CPython \u547d\u4ee4\u3002\u6b63\u5982\u8fd9\u91cc\u63d0\u5230\u7684\uff0c\u4e24\u8005\u4e4b\u95f4\u4e5f\u5b58\u5728\u4e00\u4e9b\u517c\u5bb9\u6027\u5dee\u5f02\u3002PyPy \u6700\u5f3a\u5927\u7684\u4f18\u52bf\u5728\u4e8e\u5176\u901f\u5ea6\u3002PyPy \u6bd4 CPython \u5feb\u5f97\u591a\u3002\u6211\u4eec\u7a0d\u540e\u4f1a\u770b\u5230\u4e00\u4e9b\u6d4b\u8bd5\uff0c\u5176\u4e2d PyPy \u7684\u901f\u5ea6\u5927\u7ea6\u662f CPython \u7684 7 \u500d\u3002\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u5b83\u7684\u901f\u5ea6\u751a\u81f3\u53ef\u80fd\u662f CPython \u7684\u51e0\u5341\u500d\u6216\u51e0\u767e\u500d\u3002\u90a3\u4e48\uff0cPyPy \u662f\u5982\u4f55\u5b9e\u73b0\u5982\u6b64\u9ad8\u7684\u901f\u5ea6\u7684\u5462\uff1f<\/p>\n<h5 id=\"%d8%b3%d8%b1%d8%b9%d8%aa\">\u901f\u5ea6<\/h5>\n<p>PyPy \u4f7f\u7528\u5373\u65f6 (JIT) \u7f16\u8bd1\u5668\uff0c\u53ef\u4ee5\u663e\u8457\u63d0\u5347 Python \u811a\u672c\u7684\u8fd0\u884c\u901f\u5ea6\u3002CPython \u4f7f\u7528\u7684\u662f\u63d0\u524d\u7f16\u8bd1 (AOT) \u65b9\u5f0f\uff0c\u8fd9\u610f\u5473\u7740\u6240\u6709\u4ee3\u7801\u5728\u6267\u884c\u524d\u90fd\u4f1a\u88ab\u7f16\u8bd1\u6210\u5b57\u8282\u7801\u3002\u800c JIT \u7f16\u8bd1\u5668\u53ea\u5728\u8fd0\u884c\u65f6\u9700\u8981\u65f6\u624d\u8fdb\u884c\u7f16\u8bd1\u3002.<\/p>\n<p>\u6e90\u4ee3\u7801\u4e2d\u53ef\u80fd\u5305\u542b\u4e00\u4e9b\u6839\u672c\u4e0d\u4f1a\u6267\u884c\u7684\u4ee3\u7801\u5757\uff0c\u4f46\u8fd9\u4e9b\u4ee3\u7801\u5757\u4ecd\u7136\u4f1a\u88abAOT\u7f16\u8bd1\u5668\u7f16\u8bd1\u3002\u8fd9\u4f1a\u5bfc\u81f4\u5904\u7406\u901f\u5ea6\u53d8\u6162\u3002\u5f53\u6e90\u4ee3\u7801\u5f88\u5927\uff0c\u5305\u542b\u6570\u5343\u884c\u4ee3\u7801\u65f6\uff0c\u4f7f\u7528JIT\u7f16\u8bd1\u5668\u4f1a\u5e26\u6765\u663e\u8457\u7684\u6027\u80fd\u63d0\u5347\u3002AOT\u7f16\u8bd1\u5668\u4f1a\u7f16\u8bd1\u6574\u4e2a\u6e90\u4ee3\u7801\uff0c\u56e0\u6b64\u8017\u65f6\u5f88\u957f\u3002\u800cJIT\u7f16\u8bd1\u5668\u53ea\u6267\u884c\u6240\u9700\u7684\u4ee3\u7801\u90e8\u5206\uff0c\u901f\u5ea6\u8981\u5feb\u5f97\u591a\u3002.<\/p>\n<p>PyPy \u7ffb\u8bd1\u5b8c\u4e00\u6bb5\u4ee3\u7801\u540e\uff0c\u4f1a\u5c06\u5176\u7f13\u5b58\u8d77\u6765\u3002\u8fd9\u610f\u5473\u7740\u4ee3\u7801\u53ea\u9700\u7ffb\u8bd1\u4e00\u6b21\uff0c\u4e4b\u540e\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u7ffb\u8bd1\u7ed3\u679c\u3002\u800c CPython \u89e3\u91ca\u5668\u6bcf\u6b21\u6267\u884c\u4ee3\u7801\u65f6\u90fd\u4f1a\u91cd\u590d\u7ffb\u8bd1\uff0c\u8fd9\u4e5f\u662f\u5b83\u901f\u5ea6\u6162\u7684\u539f\u56e0\u4e4b\u4e00\u3002.<\/p>\n<h5 id=\"%d8%a8%db%8c-%d8%b2%d8%ad%d9%85%d8%aa\">\u6beb\u4e0d\u8d39\u529b<\/h5>\n<p>PyPy\u5e76\u975e\u63d0\u5347Python\u811a\u672c\u6027\u80fd\u7684\u552f\u4e00\u9014\u5f84\uff0c\u4f46\u5374\u662f\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u3002\u4f8b\u5982\uff0cCython\u53ef\u4ee5\u7528\u6765\u52a0\u901f\u5c06C\u7c7b\u578b\u8d4b\u503c\u7ed9\u53d8\u91cf\u3002\u95ee\u9898\u5728\u4e8e\uff0cCython\u9700\u8981\u5f00\u53d1\u8005\u624b\u52a8\u5ba1\u67e5\u6e90\u4ee3\u7801\u5e76\u8fdb\u884c\u4f18\u5316\u3002\u8fd9\u65e2\u7e41\u7410\u53c8\u590d\u6742\uff0c\u800c\u4e14\u968f\u7740\u4ee3\u7801\u89c4\u6a21\u7684\u589e\u5927\uff0c\u4f18\u5316\u5de5\u4f5c\u91cf\u4e5f\u4f1a\u589e\u52a0\u3002\u800c\u4f7f\u7528PyPy\uff0c\u4f60\u53ea\u9700\u6beb\u4e0d\u8d39\u529b\u5730\u8fd0\u884c\u666e\u901a\u7684Python\u4ee3\u7801\uff0c\u5c31\u80fd\u663e\u8457\u63d0\u5347\u8fd0\u884c\u901f\u5ea6\u3002.<\/p>\n<h5 id=\"%d8%a8%d8%af%d9%88%d9%86-%d9%be%d8%b4%d8%aa%d9%87\">\u65e0\u5806\u53e0<\/h5>\n<p>\u6807\u51c6 Python \u4f7f\u7528 C \u8bed\u8a00\u7684\u6808\u3002\u8fd9\u4e2a\u6808\u5b58\u50a8\u7740\u51fd\u6570\u4e4b\u95f4\u76f8\u4e92\u8c03\u7528\u7684\u987a\u5e8f\uff08\u8fd4\u56de\u503c\uff09\u3002\u7531\u4e8e\u6808\u7684\u5927\u5c0f\u6709\u9650\uff0c\u51fd\u6570\u8c03\u7528\u7684\u6b21\u6570\u4e5f\u53d7\u5230\u9650\u5236\u3002.<\/p>\n<p>PyPy \u4f7f\u7528 Stackless Python\uff0c\u8fd9\u662f\u4e00\u79cd\u4e0d\u4f7f\u7528 C \u6808\u7684 Python \u5b9e\u73b0\u3002\u5b83\u5c06\u51fd\u6570\u8c03\u7528\u4e0e\u5bf9\u8c61\u4e00\u8d77\u5b58\u50a8\u5728\u6808\u4e0a\u3002\u6808\u7684\u5927\u5c0f\u5927\u4e8e\u5806\u7684\u5927\u5c0f\uff0c\u56e0\u6b64\u53ef\u4ee5\u8fdb\u884c\u66f4\u591a\u7684\u51fd\u6570\u8c03\u7528\u3002.<\/p>\n<p>\u65e0\u6808 Python \u8fd8\u652f\u6301\u5fae\u7ebf\u7a0b\uff0c\u8fd9\u6bd4\u666e\u901a\u7684 Python \u7ebf\u7a0b\u66f4\u80dc\u4e00\u7b79\u3002\u5728\u65e0\u6808 Python \u7ebf\u7a0b\u4e2d\uff0c\u60a8\u53ef\u4ee5\u8fd0\u884c\u6570\u5343\u4e2a\u79f0\u4e3a\u00ab\u4efb\u52a1\u7247\u6bb5\u00bb\uff08tasklet\uff09\u7684\u4efb\u52a1\uff0c\u6240\u6709\u8fd9\u4e9b\u4efb\u52a1\u90fd\u5728\u5355\u4e2a\u7ebf\u7a0b\u4e0a\u8fd0\u884c\u3002.<\/p>\n<p>\u4f7f\u7528\u4efb\u52a1\u7ec4\uff08tasklet\uff09\u53ef\u4ee5\u5b9e\u73b0\u4efb\u52a1\u7684\u5e76\u53d1\u6267\u884c\u3002\u5e76\u53d1\u662f\u6307\u4e24\u4e2a\u4efb\u52a1\u540c\u65f6\u8fd0\u884c\uff0c\u5171\u4eab\u76f8\u540c\u7684\u8d44\u6e90\u3002\u4e00\u4e2a\u4efb\u52a1\u8fd0\u884c\u4e00\u6bb5\u65f6\u95f4\u540e\u4f1a\u505c\u6b62\uff0c\u4ee5\u4fbf\u4e3a\u7b2c\u4e8c\u4e2a\u4efb\u52a1\u7684\u8fd0\u884c\u817e\u51fa\u7a7a\u95f4\u3002\u8bf7\u6ce8\u610f\uff0c\u8fd9\u4e0e\u5e76\u884c\u4e0d\u540c\uff0c\u5e76\u884c\u662f\u6307\u8fd0\u884c\u4e24\u4e2a\u72ec\u7acb\u4f46\u540c\u65f6\u6267\u884c\u7684\u4efb\u52a1\u3002.<\/p>\n<p>\u4f7f\u7528 Tasklet \u53ef\u4ee5\u51cf\u5c11\u521b\u5efa\u7684\u7ebf\u7a0b\u6570\u91cf\uff0c\u4ece\u800c\u964d\u4f4e\u64cd\u4f5c\u7cfb\u7edf\u7ba1\u7406\u6240\u6709\u8fd9\u4e9b\u7ebf\u7a0b\u7684\u5f00\u9500\u3002\u56e0\u6b64\uff0c\u901a\u8fc7\u5728\u4e24\u4e2a\u7ebf\u7a0b\u4e4b\u95f4\u5207\u6362\u6765\u52a0\u901f\u6267\u884c\u6240\u9700\u7684\u65f6\u95f4\u6bd4\u5728\u4e24\u4e2a\u4efb\u52a1\u4e4b\u95f4\u5207\u6362\u8981\u957f\u3002.<\/p>\n<p>\u4f7f\u7528 Stackless Python \u4e5f\u4e3a\u5ef6\u7eed\uff08Continuation\uff09\u529f\u80fd\u94fa\u5e73\u4e86\u9053\u8def\u3002\u5ef6\u7eed\u5141\u8bb8\u6211\u4eec\u4fdd\u5b58\u4efb\u52a1\u72b6\u6001\uff0c\u5e76\u5728\u4e4b\u540e\u6062\u590d\u8be5\u72b6\u6001\u4ee5\u7ee7\u7eed\u6267\u884c\u4efb\u52a1\u3002\u8bf7\u6ce8\u610f\uff0cStackless Python \u4e0e\u6807\u51c6 Python \u5e76\u65e0\u672c\u8d28\u533a\u522b\uff0c\u5b83\u53ea\u662f\u589e\u52a0\u4e86\u66f4\u591a\u529f\u80fd\u3002\u6807\u51c6 Python \u4e2d\u63d0\u4f9b\u7684\u6240\u6709\u529f\u80fd\uff0c\u5728 Stackless Python \u4e2d\u4e5f\u540c\u6837\u53ef\u7528\u3002.<\/p>\n<p>\u5728\u8ba8\u8bba\u4e86 PyPy \u7684\u4f18\u70b9\u4e4b\u540e\uff0c\u8ba9\u6211\u4eec\u5728\u4e0b\u4e00\u8282\u4e2d\u8ba8\u8bba\u5b83\u7684\u5c40\u9650\u6027\u3002.<\/p>\n<h2 id=\"%d9%85%d8%ad%d8%af%d9%88%d8%af%db%8c%d8%aa-%d9%87%d8%a7%db%8c-pypy\">PyPy \u7684\u5c40\u9650\u6027<\/h2>\n<p>\u867d\u7136 CPython \u53ef\u4ee5\u5728\u4efb\u4f55\u673a\u5668\u548c\u4efb\u4f55 CPU \u67b6\u6784\u4e0a\u4f7f\u7528\uff0c\u4f46 PyPy \u7684\u652f\u6301\u76f8\u5bf9\u6709\u9650\u3002.<\/p>\n<p>\u4ee5\u4e0b\u662f PyPy \u652f\u6301\u548c\u7ef4\u62a4\u7684 CPU \u67b6\u6784\uff08\u6765\u6e90\uff09\uff1a<\/p>\n<ul>\n<li>x86 (IA-32) \u548c x86_64<\/li>\n<li>ARM\u5e73\u53f0\uff08ARMv6\u6216ARMv7\uff0c\u5e26VFPv3\uff09<\/li>\n<li>AArch64<\/li>\n<li>PowerPC 64 \u4f4d\uff0c\u5c0f\u7aef\u548c\u5927\u7aef\u5747\u53ef<\/li>\n<li>System Z (s390x)<\/li>\n<\/ul>\n<p>PyPy\u5e76\u975e\u5728\u6240\u6709Linux\u53d1\u884c\u7248\u4e0a\u90fd\u80fd\u8fd0\u884c\uff0c\u56e0\u6b64\u8bf7\u52a1\u5fc5\u4f7f\u7528\u53d7\u652f\u6301\u7684\u53d1\u884c\u7248\u3002\u5728\u4e0d\u53d7\u652f\u6301\u7684\u53d1\u884c\u7248\u4e0a\u8fd0\u884cPyPy Linux\u4e8c\u8fdb\u5236\u6587\u4ef6\u5c06\u4f1a\u62a5\u9519\u3002PyPy\u4ec5\u652f\u6301\u4e00\u4e2a\u7248\u672c\u7684Python 2\u548cPython 3\uff0c\u5206\u522b\u662fPyPy 2.7\u548cPyPy 3.6\u3002.<\/p>\n<p>\u5982\u679c PyPy \u8fd0\u884c\u7684\u4ee3\u7801\u662f\u7eaf Python \u4ee3\u7801\uff0c\u90a3\u4e48\u5b83\u5e26\u6765\u7684\u901f\u5ea6\u63d0\u5347\u901a\u5e38\u975e\u5e38\u663e\u8457\u3002\u4f46\u662f\uff0c\u5982\u679c\u4ee3\u7801\u5305\u542b NumPy \u7b49 C \u6269\u5c55\uff0cPyPy \u5b9e\u9645\u4e0a\u53ef\u80fd\u4f1a\u589e\u52a0\u8fd0\u884c\u65f6\u95f4\u3002PyPy \u9879\u76ee\u76ee\u524d\u4ecd\u5728\u79ef\u6781\u5f00\u53d1\u4e2d\uff0c\u56e0\u6b64\u672a\u6765\u53ef\u80fd\u4f1a\u63d0\u4f9b\u5bf9 C \u6269\u5c55\u66f4\u597d\u7684\u652f\u6301\u3002.<\/p>\n<p>PyPy \u4e0d\u53d7\u8bb8\u591a\u6d41\u884c\u7684 Python \u6846\u67b6\uff08\u4f8b\u5982 Kivy\uff09\u7684\u652f\u6301\u3002Kivy \u5141\u8bb8 CPython \u5728\u5305\u62ec Android \u548c iOS \u5728\u5185\u7684\u6240\u6709\u5e73\u53f0\u4e0a\u8fd0\u884c\u3002\u8fd9\u610f\u5473\u7740 PyPy \u65e0\u6cd5\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u8fd0\u884c\u3002.<\/p>\n<p>\u73b0\u5728\u6211\u4eec\u5df2\u7ecf\u4e86\u89e3\u4e86 PyPy \u7684\u4f18\u70b9\u548c\u5c40\u9650\u6027\uff0c\u63a5\u4e0b\u6765\u8ba9\u6211\u4eec\u89e3\u91ca\u4e00\u4e0b\u5982\u4f55\u5728 Ubuntu \u4e0a\u8fd0\u884c PyPy\u3002.<\/p>\n<h2 id=\"%d8%a7%d8%ac%d8%b1%d8%a7%db%8c-pypy-%d8%af%d8%b1-%d8%a7%d9%88%d8%a8%d9%88%d9%86%d8%aa%d9%88\">\u5728 Ubuntu \u4e0a\u8fd0\u884c PyPy<\/h2>\n<p>PyPy \u53ef\u4ee5\u5728 Mac\u3001Linux \u6216 Windows \u4e0a\u8fd0\u884c\uff0c\u4f46\u6211\u4eec\u5c06\u8ba8\u8bba\u5982\u4f55\u5728 Ubuntu \u4e0a\u8fd0\u884c\u5b83\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0cPyPy \u7684 Linux \u4e8c\u8fdb\u5236\u6587\u4ef6\u4ec5\u652f\u6301\u7279\u5b9a\u7684 Linux \u53d1\u884c\u7248\u3002\u60a8\u53ef\u4ee5\u5728\u6b64\u9875\u9762\u67e5\u770b\u53ef\u7528\u7684 PyPy \u4e8c\u8fdb\u5236\u6587\u4ef6\u53ca\u5176\u652f\u6301\u7684\u53d1\u884c\u7248\u3002\u4f8b\u5982\uff0cPyPy\uff08\u6216 Python 2.7 \u6216 Python 3.6\uff09\u4ec5\u652f\u6301\u4e09\u4e2a\u7248\u672c\u7684 Ubuntu\uff1a18.04\u300116.04 \u548c 14.04\u3002\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u622a\u81f3\u76ee\u524d\u4e3a\u6b62\u7684\u6700\u65b0\u7248\u672c Ubuntu\uff0819.10\uff09\uff0c\u5219\u65e0\u6cd5\u5728\u5176\u4e0a\u8fd0\u884c PyPy\u3002\u5c1d\u8bd5\u5728\u4e0d\u53d7\u652f\u6301\u7684\u53d1\u884c\u7248\u4e0a\u8fd0\u884c PyPy \u5c06\u8fd4\u56de\u4ee5\u4e0b\u9519\u8bef\uff1a<\/p>\n<p>PyPy \u4e8c\u8fdb\u5236\u6587\u4ef6\u4ee5\u538b\u7f29\u6587\u4ef6\u7684\u5f62\u5f0f\u63d0\u4f9b\u3002\u60a8\u53ea\u9700\u89e3\u538b\u7f29\u4e0b\u8f7d\u7684\u6587\u4ef6\u5373\u53ef\u3002\u89e3\u538b\u7f29\u540e\u7684\u6587\u4ef6\u5939\u4e2d\u6709\u4e00\u4e2a\u540d\u4e3a bin \u7684\u6587\u4ef6\u5939\uff0cPyPy \u53ef\u6267\u884c\u6587\u4ef6\u5c31\u4f4d\u4e8e\u5176\u4e2d\u3002\u6211\u4f7f\u7528\u7684\u662f Python 3.6\uff0c\u6240\u4ee5\u6587\u4ef6\u540d\u4e3a pypy3\u3002\u5bf9\u4e8e Python 2.7\uff0c\u6587\u4ef6\u540d\u4e3a pypy\u3002.<\/p>\n<p>\u5bf9\u4e8e CPython\uff0c\u5982\u679c\u60f3\u4ece\u7ec8\u7aef\u8fd0\u884c Python 3\uff0c\u53ea\u9700\u8f93\u5165\u547d\u4ee4 python3\u3002\u8981\u8fd0\u884c PyPy\uff0c\u53ea\u9700\u53d1\u51fa\u547d\u4ee4 pypy3\u3002.<\/p>\n<p>\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u5728\u7ec8\u7aef\u8f93\u5165 `pypy3` \u547d\u4ee4\u53ef\u80fd\u4f1a\u8fd4\u56de\u2018\u627e\u4e0d\u5230 &#039;pypy3&#039;\u2019\u7684\u9519\u8bef\u4fe1\u606f\u3002\u8fd9\u662f\u56e0\u4e3a PyPy \u7684\u8def\u5f84\u5c1a\u672a\u6dfb\u52a0\u5230 PATH \u73af\u5883\u53d8\u91cf\u4e2d\u3002\u6b63\u786e\u7684\u547d\u4ee4\u662f `.\/pypy3`\uff0c\u524d\u63d0\u662f\u7ec8\u7aef\u5f53\u524d\u8def\u5f84\u4f4d\u4e8e PyPy \u7684 bin \u76ee\u5f55\u5185\u3002`.` \u6307\u7684\u662f\u5f53\u524d\u76ee\u5f55\uff0c`\/` \u7528\u4e8e\u8bbf\u95ee\u5f53\u524d\u76ee\u5f55\u4e2d\u7684\u67d0\u4e2a\u6587\u4ef6\u3002\u6267\u884c `.\/pypy3` \u547d\u4ee4\u53ef\u4ee5\u6210\u529f\u8fd0\u884c Python \u7a0b\u5e8f\u3002.<\/p>\n<p><img  loading=\"lazy\"  decoding=\"async\"  src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAP+KeNJXAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=\"  alt=\"\"  width=\"734\"  height=\"298\"  class=\"aligncenter wp-image-16215 size-full pk-lazyload\"  data-pk-sizes=\"auto\"  data-ls-sizes=\"auto, (max-width: 734px) 100vw, 734px\"  data-pk-src=\"https:\/\/cdn.itpiran.net\/2024\/10\/10200135\/2-1.png\"  data-pk-srcset=\"https:\/\/cdn.itpiran.net\/2024\/10\/10200135\/2-1.png 734w, https:\/\/cdn.itpiran.net\/2024\/10\/10200135\/2-1-300x122.png 300w, https:\/\/cdn.itpiran.net\/2024\/10\/10200135\/2-1-110x45.png 110w, https:\/\/cdn.itpiran.net\/2024\/10\/10200135\/2-1-200x81.png 200w, https:\/\/cdn.itpiran.net\/2024\/10\/10200135\/2-1-380x154.png 380w, https:\/\/cdn.itpiran.net\/2024\/10\/10200135\/2-1-255x104.png 255w, https:\/\/cdn.itpiran.net\/2024\/10\/10200135\/2-1-550x223.png 550w\" ><\/p>\n<p>\u73b0\u5728\u4f60\u53ef\u4ee5\u50cf\u5f80\u5e38\u4e00\u6837\u4f7f\u7528 Python\uff0c\u5e76\u5229\u7528 PyPy \u7684\u4f18\u52bf\u3002\u4f8b\u5982\uff0c\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684 Python \u811a\u672c\u6765\u8ba1\u7b97 1000 \u4e2a\u6570\u5b57\u7684\u548c\uff0c\u5e76\u4f7f\u7528 PyPy \u8fd0\u884c\u5b83\u3002\u4ee3\u7801\u5982\u4e0b\u3002.<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>nums = range(1000)\r\nsum = 0\r\nfor k in nums:\r\nsum = sum + k\r\nprint(\"Sum of 1,000 numbers is : \", sum)<\/code><\/pre>\n<\/div>\n<p>\u5982\u679c\u8be5\u811a\u672c\u540d\u4e3a test.py\uff0c\u60a8\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fd0\u884c\u5b83\uff08\u5047\u8bbe Python \u6587\u4ef6\u4f4d\u4e8e PyPy bin \u6587\u4ef6\u5939\u4e2d\uff0c\u8be5\u6587\u4ef6\u5939\u4e0e pypy3 \u547d\u4ee4\u4f4d\u4e8e\u540c\u4e00\u4f4d\u7f6e\uff09\u3002.<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>.\/pypy3 test.py\r\n<\/code><\/pre>\n<\/div>\n<p>\u4e0b\u56fe\u663e\u793a\u4e86\u6267\u884c\u524d\u9762\u4ee3\u7801\u7684\u7ed3\u679c\u3002.<\/p>\n<p><img  loading=\"lazy\"  decoding=\"async\"  src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEUAAP+KeNJXAAAAAXRSTlMAQObYZgAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAApJREFUCNdjYAAAAAIAAeIhvDMAAAAASUVORK5CYII=\"  alt=\"\"  width=\"736\"  height=\"131\"  class=\"aligncenter wp-image-16216 size-full pk-lazyload\"  data-pk-sizes=\"auto\"  data-ls-sizes=\"auto, (max-width: 736px) 100vw, 736px\"  data-pk-src=\"https:\/\/cdn.itpiran.net\/2024\/10\/10200552\/3-1.png\"  data-pk-srcset=\"https:\/\/cdn.itpiran.net\/2024\/10\/10200552\/3-1.png 736w, https:\/\/cdn.itpiran.net\/2024\/10\/10200552\/3-1-300x53.png 300w, https:\/\/cdn.itpiran.net\/2024\/10\/10200552\/3-1-110x20.png 110w, https:\/\/cdn.itpiran.net\/2024\/10\/10200552\/3-1-200x36.png 200w, https:\/\/cdn.itpiran.net\/2024\/10\/10200552\/3-1-380x68.png 380w, https:\/\/cdn.itpiran.net\/2024\/10\/10200552\/3-1-255x45.png 255w, https:\/\/cdn.itpiran.net\/2024\/10\/10200552\/3-1-550x98.png 550w\" ><\/p>\n<h2 id=\"%d8%b2%d9%85%d8%a7%d9%86-%d8%a7%d8%ac%d8%b1%d8%a7%db%8c-pypy-%d8%af%d8%b1-%d9%85%d9%82%d8%a7%d8%a8%d9%84-cpython\">PyPy \u4e0e CPython \u8fd0\u884c\u65f6\u5bf9\u6bd4<\/h2>\n<p>\u4e3a\u4e86\u6bd4\u8f83 PyPy \u548c CPython \u8ba1\u7b97 1000 \u4e2a\u6570\u5b57\u4e4b\u548c\u7684\u6267\u884c\u65f6\u95f4\uff0c\u6d4b\u91cf\u65f6\u95f4\u7684\u4ee3\u7801\u5982\u4e0b\u3002.<\/p>\n<div class=\"hcb_wrap\" data-no-translation=\"\" data-no-auto-translation=\"\">\n<pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code>import time\r\nt1 = time.time()\r\nnums = range(1000)\r\nsum = 0\r\nfor k in nums:\r\nsum = sum + k\r\nprint(\"Sum of 1,000 numbers is : \", sum)\r\nt2 = time.time()\r\nt = t2 - t1\r\nprint(\"Elapsed time is : \", t, \" seconds\")<\/code><\/pre>\n<\/div>\n<p>PyPy \u7684\u8fd0\u884c\u65f6\u95f4\u63a5\u8fd1 0.00045 \u79d2\uff0c\u800c CPython \u5219\u4e3a 0.0002 \u79d2\uff08\u6211\u7684\u673a\u5668\u914d\u7f6e\u4e3a 2.5 GHz \u7684 Core i7-6500U\uff09\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cCPython \u7684\u8fd0\u884c\u65f6\u95f4\u6bd4 PyPy \u77ed\uff0c\u8fd9\u4e5f\u5728\u610f\u6599\u4e4b\u4e2d\uff0c\u56e0\u4e3a\u8fd9\u5e76\u975e\u4e00\u4e2a\u8017\u65f6\u8f83\u957f\u7684\u4efb\u52a1\u3002\u5982\u679c\u4ee3\u7801\u9700\u8981\u8ba1\u7b97 100 \u4e07\u4e2a\u6570\u5b57\u800c\u4e0d\u662f 1000 \u4e2a\uff0c\u90a3\u4e48 PyPy \u6700\u7ec8\u4f1a\u80dc\u51fa\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cPyPy \u7684\u8fd0\u884c\u65f6\u95f4\u4e3a 0.00035 \u79d2\uff0c\u800c CPython \u5219\u9700\u8981 0.1 \u79d2\u3002PyPy \u7684\u4f18\u52bf\u663e\u800c\u6613\u89c1\u3002\u8fd9\u5e94\u8be5\u80fd\u8ba9\u4f60\u660e\u767d CPython \u5728\u5904\u7406\u957f\u65f6\u95f4\u8fd0\u884c\u7684\u4efb\u52a1\u65f6\u901f\u5ea6\u6709\u591a\u4e48\u6162\u3002.<\/p>\n<h2 id=\"%d9%86%d8%aa%db%8c%d8%ac%d9%87\">\u7ed3\u679c<\/h2>\n<p>\u672c\u6559\u7a0b\u5c06\u4ecb\u7ecd PyPy\uff0c\u5b83\u662f\u901f\u5ea6\u6700\u5feb\u7684 Python \u5b9e\u73b0\u3002PyPy \u7684\u4e3b\u8981\u4f18\u52bf\u5728\u4e8e\u5176\u5373\u65f6 (JIT) \u7f16\u8bd1\uff0c\u5b83\u4f1a\u5c06\u7f16\u8bd1\u540e\u7684\u673a\u5668\u4ee3\u7801\u7f13\u5b58\u8d77\u6765\uff0c\u9632\u6b62\u91cd\u590d\u6267\u884c\u3002\u6559\u7a0b\u4e5f\u4f1a\u91cd\u70b9\u4ecb\u7ecd PyPy \u7684\u5c40\u9650\u6027\uff0c\u5176\u4e2d\u6700\u4e3b\u8981\u7684\u4e00\u70b9\u662f\u5b83\u867d\u7136\u5bf9\u7eaf Python \u4ee3\u7801\u8868\u73b0\u51fa\u8272\uff0c\u4f46\u5bf9 C \u6269\u5c55\u7684\u6548\u7387\u4e0d\u9ad8\u3002.<\/p>\n<p>\u6211\u4eec\u8fd8\u4e86\u89e3\u4e86 PyPy \u5728 Ubuntu \u4e0a\u7684\u8fd0\u884c\u60c5\u51b5\uff0c\u5e76\u6bd4\u8f83\u4e86 CPython \u548c PyPy \u7684\u6267\u884c\u65f6\u95f4\uff0c\u91cd\u70b9\u5c55\u793a\u4e86 PyPy \u5728\u5904\u7406\u957f\u65f6\u95f4\u8fd0\u884c\u4efb\u52a1\u65b9\u9762\u7684\u6027\u80fd\u4f18\u52bf\u3002\u540c\u65f6\uff0cCPython \u5728\u5904\u7406\u77ed\u65f6\u95f4\u8fd0\u884c\u4efb\u52a1\u65b9\u9762\u53ef\u80fd\u4ecd\u7136\u4f18\u4e8e PyPy\u3002\u6211\u4eec\u5c06\u5728\u540e\u7eed\u6587\u7ae0\u4e2d\u8fdb\u4e00\u6b65\u63a2\u8ba8 PyPy\u3001CPython \u548c Cython \u4e4b\u95f4\u7684\u6bd4\u8f83\u3002.<\/p>","protected":false},"excerpt":{"rendered":"\u5f15\u8a00\uff1aPython\u7f16\u7a0b\u8bed\u8a00\u662f\u4e00\u79cd\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u5b9e\u73b0\u7684\u63a5\u53e3\u2026\u2026","protected":false},"author":1,"featured_media":16212,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_yoast_wpseo_focuskw":"\u0634\u0631\u0648\u0639 \u06a9\u0627\u0631 \u0628\u0627 PyPy","_yoast_wpseo_title":"","_yoast_wpseo_metadesc":"","_yoast_wpseo_canonical":"","_yoast_wpseo_opengraph-description":"","_yoast_wpseo_opengraph-image":"","_yoast_wpseo_twitter-description":"","_yoast_wpseo_twitter-image":"","_yoast_wpseo_focuskeywords":"","_yoast_wpseo_primary_category":"193","footnotes":""},"categories":[193,363],"tags":[435,376],"class_list":{"0":"post-16211","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-tutorials","8":"category-programming","9":"tag-programming","10":"tag-python"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u0634\u0631\u0648\u0639 \u06a9\u0627\u0631 \u0628\u0627 PyPy - \u0628\u0644\u0627\u06af ITPiran<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.itpiran.net\/blog\/zh\/tutorials\/getting-started-with-pypy\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0634\u0631\u0648\u0639 \u06a9\u0627\u0631 \u0628\u0627 PyPy - \u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"og:description\" content=\"\u0645\u0642\u062f\u0645\u0647 \u0632\u0628\u0627\u0646 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u067e\u0627\u06cc\u062a\u0648\u0646 \u06cc\u06a9 \u0631\u0627\u0628\u0637 \u0627\u0633\u062a \u06a9\u0647 \u0645\u06cc \u062a\u0648\u0627\u0646\u062f \u0628\u0647 \u0631\u0648\u0634 \u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641\u06cc \u067e\u06cc\u0627\u062f\u0647 \u0633\u0627\u0632\u06cc \u0634\u0648\u062f.&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.itpiran.net\/blog\/zh\/tutorials\/getting-started-with-pypy\/\" \/>\n<meta property=\"og:site_name\" content=\"\u0628\u0644\u0627\u06af ITPiran\" \/>\n<meta property=\"article:published_time\" content=\"2024-10-10T16:39:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.itpiran.net\/2024\/10\/10195153\/PYPY-wallpaper.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1793\" \/>\n\t<meta property=\"og:image:height\" content=\"1110\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\"},\"headline\":\"\u0634\u0631\u0648\u0639 \u06a9\u0627\u0631 \u0628\u0627 PyPy\",\"datePublished\":\"2024-10-10T16:39:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/\"},\"wordCount\":187,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/10\\\/10195153\\\/PYPY-wallpaper.jpg\",\"keywords\":[\"programming\",\"Python\"],\"articleSection\":[\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/\",\"name\":\"\u0634\u0631\u0648\u0639 \u06a9\u0627\u0631 \u0628\u0627 PyPy - \u0628\u0644\u0627\u06af ITPiran\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/10\\\/10195153\\\/PYPY-wallpaper.jpg\",\"datePublished\":\"2024-10-10T16:39:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/#primaryimage\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/10\\\/10195153\\\/PYPY-wallpaper.jpg\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2024\\\/10\\\/10195153\\\/PYPY-wallpaper.jpg\",\"width\":1793,\"height\":1110},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/tutorials\\\/getting-started-with-pypy\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0622\u0645\u0648\u0632\u0634\u06cc\",\"item\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/category\\\/tutorials\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u0634\u0631\u0648\u0639 \u06a9\u0627\u0631 \u0628\u0627 PyPy\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"name\":\"\u0628\u0644\u0627\u06af ITPiran\",\"description\":\"\u0627\u062e\u0628\u0627\u0631 \u0648 \u0645\u0642\u0627\u0644\u0627\u062a \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#organization\",\"name\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\",\"alternateName\":\"ITPIran Blog\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"contentUrl\":\"https:\\\/\\\/cdn.itpiran.net\\\/2023\\\/12\\\/27150508\\\/cropped-ITPIRAN-BLOG-LOGO-2.png\",\"width\":512,\"height\":512,\"caption\":\"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646\"},\"image\":{\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/#\\\/schema\\\/person\\\/04ed27b919baca468a2273f8e4318f81\",\"name\":\"admin\",\"url\":\"https:\\\/\\\/www.itpiran.net\\\/blog\\\/zh\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PyPy\u5165\u95e8\u6307\u5357 - ITPiran\u535a\u5ba2","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.itpiran.net\/blog\/zh\/tutorials\/getting-started-with-pypy\/","og_locale":"zh_CN","og_type":"article","og_title":"\u0634\u0631\u0648\u0639 \u06a9\u0627\u0631 \u0628\u0627 PyPy - \u0628\u0644\u0627\u06af ITPiran","og_description":"\u0645\u0642\u062f\u0645\u0647 \u0632\u0628\u0627\u0646 \u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc \u067e\u0627\u06cc\u062a\u0648\u0646 \u06cc\u06a9 \u0631\u0627\u0628\u0637 \u0627\u0633\u062a \u06a9\u0647 \u0645\u06cc \u062a\u0648\u0627\u0646\u062f \u0628\u0647 \u0631\u0648\u0634 \u0647\u0627\u06cc \u0645\u062e\u062a\u0644\u0641\u06cc \u067e\u06cc\u0627\u062f\u0647 \u0633\u0627\u0632\u06cc \u0634\u0648\u062f.&hellip;","og_url":"https:\/\/www.itpiran.net\/blog\/zh\/tutorials\/getting-started-with-pypy\/","og_site_name":"\u0628\u0644\u0627\u06af ITPiran","article_published_time":"2024-10-10T16:39:25+00:00","og_image":[{"width":1793,"height":1110,"url":"https:\/\/cdn.itpiran.net\/2024\/10\/10195153\/PYPY-wallpaper.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/#article","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/"},"author":{"name":"admin","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81"},"headline":"\u0634\u0631\u0648\u0639 \u06a9\u0627\u0631 \u0628\u0627 PyPy","datePublished":"2024-10-10T16:39:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/"},"wordCount":187,"commentCount":0,"publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/10\/10195153\/PYPY-wallpaper.jpg","keywords":["programming","Python"],"articleSection":["\u0622\u0645\u0648\u0632\u0634\u06cc","\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06cc\u0633\u06cc"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/","url":"https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/","name":"PyPy\u5165\u95e8\u6307\u5357 - ITPiran\u535a\u5ba2","isPartOf":{"@id":"https:\/\/www.itpiran.net\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/#primaryimage"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn.itpiran.net\/2024\/10\/10195153\/PYPY-wallpaper.jpg","datePublished":"2024-10-10T16:39:25+00:00","breadcrumb":{"@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/#primaryimage","url":"https:\/\/cdn.itpiran.net\/2024\/10\/10195153\/PYPY-wallpaper.jpg","contentUrl":"https:\/\/cdn.itpiran.net\/2024\/10\/10195153\/PYPY-wallpaper.jpg","width":1793,"height":1110},{"@type":"BreadcrumbList","@id":"https:\/\/www.itpiran.net\/blog\/tutorials\/getting-started-with-pypy\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.itpiran.net\/blog\/"},{"@type":"ListItem","position":2,"name":"\u0622\u0645\u0648\u0632\u0634\u06cc","item":"https:\/\/www.itpiran.net\/blog\/category\/tutorials\/"},{"@type":"ListItem","position":3,"name":"\u0634\u0631\u0648\u0639 \u06a9\u0627\u0631 \u0628\u0627 PyPy"}]},{"@type":"WebSite","@id":"https:\/\/www.itpiran.net\/blog\/#website","url":"https:\/\/www.itpiran.net\/blog\/","name":"ITPiran\u535a\u5ba2","description":"\u4f0a\u6717\u53ef\u6301\u7eed\u8d38\u6613\u65b0\u95fb\u548c\u6587\u7ae0","publisher":{"@id":"https:\/\/www.itpiran.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.itpiran.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":"Organization","@id":"https:\/\/www.itpiran.net\/blog\/#organization","name":"\u4f0a\u6717\u53ef\u6301\u7eed\u5546\u4e1a\u535a\u5ba2","alternateName":"ITPIran Blog","url":"https:\/\/www.itpiran.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","contentUrl":"https:\/\/cdn.itpiran.net\/2023\/12\/27150508\/cropped-ITPIRAN-BLOG-LOGO-2.png","width":512,"height":512,"caption":"\u0628\u0644\u0627\u06af \u062a\u062c\u0627\u0631\u062a \u067e\u0627\u06cc\u062f\u0627\u0631 \u0627\u06cc\u0631\u0627\u0646\u06cc\u0627\u0646"},"image":{"@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.itpiran.net\/blog\/#\/schema\/person\/04ed27b919baca468a2273f8e4318f81","name":"\u884c\u653f","url":"https:\/\/www.itpiran.net\/blog\/zh\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/posts\/16211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/comments?post=16211"}],"version-history":[{"count":2,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/posts\/16211\/revisions"}],"predecessor-version":[{"id":16217,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/posts\/16211\/revisions\/16217"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/media\/16212"}],"wp:attachment":[{"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/media?parent=16211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/categories?post=16211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.itpiran.net\/blog\/zh\/wp-json\/wp\/v2\/tags?post=16211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}