I come across this Python lib (TinyDb). All seems very professional, documentation, installer, API etc.
I am very interested in this lib. In theory at least, this seems like a perfect beginners database as well as a light weight replacement for ConfigParser (not all the functionality, but for just saving and retrieving values). Just easy to be able to pass Python dicts to it.
I read about it, it's not a performance db by any means. And you need to be careful what api calls you make. Eg db.insert over db.multiple_insert. It's not a small difference, it's huge.
Anyway, after playing with it for a while, I thought I would make a wrapper class for it. Listed below. But when I run it, i am getting a long pause. And the pause occurs different places in the code.
The frustrating thing is that I have tried to put timing code around everything. But what is reported and what actually happens is very different.
There is a pic below of the times it reports. But it's off by 3 to 4 seconds. I don't know where the time can leak. I tried to cover it all. I have done everything. To closing all apps and restarting my ipad. It's the same.
If anyone has some knowledge of tinydb or can see what I am doing wrong, would appreciate any guidance

# coding: utf-8
from datetime import datetime
start = datetime.now()
from tinydb import TinyDB, Query
import json
finish = datetime.now()
print 'tinydb + json load time = ' , finish - start
class TinyDbWrapper(object):
def __init__(self, db_name, purge = False):
self.db = TinyDB(db_name)
if purge:
self.db.purge()
if __name__ == '__main__':
s1 = datetime.now() # overall timing
start = datetime.now() # create the object, open db timing
tdb = TinyDbWrapper('elf.json')
finish = datetime.now()
print 'open = ', finish - start # timing for the create, open
s2 = datetime.now()
print 'total time =', s2 - s1 # the timing overall
