【文件属性】:
文件名称:fast_than_strptime:比strptime()快什么?
文件大小:3KB
文件格式:ZIP
更新时间:2021-02-18 08:49:12
Python
有什么比strptime()更快的速度?
我最近在做一个项目,其中代码花费2.5秒调用datetime.strptime() 。 我开始怀疑我是否可以采取任何措施来加快速度,并尝试了多种不同的方法。 该存储库中的代码使您可以轻松地比较将基于字符串的时间戳转换为日期时间对象的各种方法。 我写关于这些不同方法。
运行此代码:
克隆并创建虚拟环境:
$ git clone https://github.com/ehmatthes/faster_than_strptime.git
$ cd faster_than_strptime
faster_than_strptime$ python3 -m venv venv
faster_than_strptime$ source venv/bin/activate
faster_than_strptime$ pip install -r r
【文件预览】:
faster_than_strptime-master
----requirements.txt(90B)
----generate_data.py(858B)
----.gitignore(80B)
----readme.md(1KB)
----process_data.py(3KB)