1 Star 0 Fork 84

skipin / 抖音爬虫

forked from 二毛 / 抖音爬虫
关闭
 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
test.py 464 Bytes
一键复制 编辑 原始数据 按行查看 历史
二毛 提交于 2023-05-21 12:13 . base
import json
import time
import ujson
def benchmark(name, dump, load):
start = time.time()
for i in range(1000):
with open('1.json', 'r', encoding='utf-8') as f:
m = load(f)
with open('1.json', 'w', encoding='utf-8') as f:
dump(m, f, ensure_ascii=False)
print(name, time.time() - start)
if __name__ == "__main__":
benchmark("Python", json.dump, json.load)
benchmark("ujson", ujson.dump, ujson.load)
Python
1
https://gitee.com/skipin/douyin.git
git@gitee.com:skipin/douyin.git
skipin
douyin
抖音爬虫
v3

搜索帮助