22
loading...
This website collects cookies to deliver better user experience
DB
class.pip3 install pysondb
# test.py
from time import time
from pysondb import db
a = db.getDb("test.json")
t1 = time()
for i in range(1000):
a.add({"name": f"name{i}", "age": i})
t2 = time()
print(t2 - t1)
$ py test.py
7.166365623474121
pip3 install strip.pysondb
# test2.py
from time import time
from pysondb import DB
db = DB(keys = ["name", "age"])
t1 = time()
for i in range(1000):
db.add({"name": f"name{i}", "age": i})
db.commit("test2.json")
t2 = time()
print(t2 - t1)
$ py test2.py
0.009546756744384