Speeding Up Python

后端 未结 18 1128
无人及你
无人及你 2020-12-02 04:55

This is really two questions, but they are so similar, and to keep it simple, I figured I\'d just roll them together:

  • Firstly: Given an est

18条回答
  •  一整个雨季
    2020-12-02 05:34

    It's often possible to achieve near-C speeds (close enough for any project using Python in the first place!) by replacing explicit algorithms written out longhand in Python with an implicit algorithm using a built-in Python call. This works because most Python built-ins are written in C anyway. Well, in CPython of course ;-) https://www.python.org/doc/essays/list2str/

提交回复
热议问题