{"id":75045,"date":"2023-09-21T14:10:05","date_gmt":"2023-09-21T06:10:05","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=75045"},"modified":"2023-09-21T14:10:05","modified_gmt":"2023-09-21T06:10:05","slug":"python-compete","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/python-compete.html","title":{"rendered":"\u201c\u6162\u201d\u4e0b\u6765\u7684 Python \u8981\u600e\u4e48\u7ade\u4e89\uff1f"},"content":{"rendered":"
\u5728 2017 \u5e74 Python \u8bed\u8a00\u5cf0\u4f1a\u4e0a\uff0cVictor Stinner \u63d0\u51fa\u4e86\u4e00\u4e9b\u6539\u8fdb Python \u6027\u80fd\u7684\u60f3\u6cd5\uff0c\u4ed6\u8ba4\u4e3a\u7528\u6237\u73b0\u5728\u6b63\u5728\u5c06 Python \u7684\u6027\u80fd\u4e0e Rust \u6216 Go \u8fdb\u884c\u6bd4\u8f83\uff0cPython \u6838\u5fc3\u5f00\u53d1\u4eba\u5458\u9700\u8981\u627e\u5230\u4e00\u79cd\u52a0\u901f Python \u7684\u65b9\u6cd5\uff0c\u4ee5\u4fdd\u6301\u5176\u4e0e\u5176\u4ed6\u8bed\u8a00\u7684\u7ade\u4e89\u529b\u3002<\/p>\n
\u4f46 Stinner \u4e5f\u8868\u793a Python \u5e76\u4e0d\u50cf\u5176\u4ed6\u8bed\u8a00\u90a3\u6837\u5bb9\u6613\u4f18\u5316\uff0c\u4e3b\u8981\u662f\u56e0\u4e3a C API \u963b\u788d\u4e86\u8fd9\u4e00\u5757\u7684\u521b\u65b0\u6027\u53d1\u5c55\u3002 PyPy \u7684 CPyExt API \u5df2\u7ecf\u53d6\u5f97\u4e86\u5f88\u5927\u7684\u8fdb\u6b65\uff0c\u4f46\u4ecd\u7136\u6709\u4e00\u4e9b\u8f7b\u5fae\u7684\u517c\u5bb9\u6027\u95ee\u9898\u3002 PyPy \u51e0\u5e74\u524d\u66fe\u8bd5\u56fe\u91cd\u65b0\u5b9e\u73b0 NumPy \u6269\u5c55\uff0c\u6700\u7ec8\u4e5f\u5931\u8d25\u4e86\u3002 NumPy \u662f Python \u7684 C \u6269\u5c55\u5305\u4e4b\u4e00\uff0c\u4ece\u672c\u8d28\u4e0a\u6765\u8bf4\u5fc5\u987b\u9002\u7528\u4e8e\u4efb\u4f55\u66ff\u4ee3\u5b9e\u73b0\uff0c\u4f46\u73b0\u5b9e\u5374\u5e76\u672a\u505a\u5230\u5982\u6b64\u3002<\/p>\n
<\/p>\n
Stinner \u8ba4\u4e3a just-in-time (JIT) \u7f16\u8bd1\u53ef\u80fd\u662f\u4e00\u79cd\u65b9\u5411\uff0c\u4f46\u53ef\u60dc\u7684\u662f\u5728\u5404\u79cd\u9879\u76ee\u4e0a\u5c1d\u8bd5\uff08\u5982 Unladen Swallow\u3001Pyston \u548c Pyjion \uff09\u540e\uff0c\u90fd\u672a\u80fd\u6210\u529f\u3002\u53e6\u5916\uff0cPyPy \u4f7f Python \u7684\u901f\u5ea6\u63d0\u9ad8\u4e86\u4e94\u500d\uff0c\u662f\u5426\u5e94\u8be5\u653e\u5f03 CPython \u800c\u63a8\u5e7f PyPy \uff1f\u5728\u4ed6\u770b\u6765\uff0c\u8bb8\u591a\u6838\u5fc3\u5f00\u53d1\u4eba\u5458\u66f4\u559c\u6b22 CPython \u548c C API\uff0c\u4f46\u5982\u679c Python \u60f3\u5728\u5f53\u4eca\u7684\u8bed\u8a00\u7ec4\u5408\u4e2d\u5177\u6709\u7ade\u4e89\u529b\uff0c\u5219\u9700\u8981 JIT \u6216\u8f6c\u5230 PyPy \u3002<\/p>\n
Stinner \u8fd8\u63d0\u51fa\u4e86\u4e00\u4e9b\u5176\u5b83\u7684\u60f3\u6cd5\uff0c\u6bd4\u5982\u8bf4\u4e5f\u8bb8\u53ef\u4ee5\u521b\u5efa\u4e00\u4e2a\u7c7b\u4f3c\u4e8e Python \u7684\u65b0\u8bed\u8a00\uff0c\u4f46\u66f4\u4e3a\u4e25\u683c\uff0c\u5c31\u50cf Hack for PHP \u90a3\u6837\uff0c\u6216\u8bb8\u80fd\u5b9e\u73b0 2x \u76ee\u6807\u3002\u63d0\u524d\u7f16\u8bd1\uff08AoT\uff09\uff0c\u4e5f\u53ef\u80fd\u662f\u4e00\u79cd\u5b9e\u73b0 JIT \u800c\u65e0\u9700\u957f\u65f6\u95f4\u9884\u70ed\u7684\u53ef\u80fd\u6027\u3002\u53e6\u5916\u50cf\u662f\u591a\u7ea7 JIT \uff0c\u7c7b\u4f3c JavaScript\uff0c\u6216\u8bb8\u4e5f\u80fd\u5e26\u6765\u6027\u80fd\u63d0\u5347\u3002<\/p>\n
\n\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/www.oschina.net\/news\/85646\/keeping-python-competitive<\/a><\/p>\n