MrPigss / BetterJSONStorage

Better JSONStorage for tinyDB
https://pypi.org/project/BetterJSONStorage/
MIT License
30 stars 3 forks source link

[Feature Request] Asyncio support #8

Open kaliiiiiiiiii opened 7 months ago

kaliiiiiiiiii commented 7 months ago

For DiskIO, asyncio support would be nice. ( + optionally multiprocessing for CPU-bound search)

To my knowledge, read//write to disk is (altho depending on OS) generally only supported blocking. Therefore, I'd propose using a threadpool for this.

https://github.com/aiotinydb/aiotinydb already has that implemented, however assuming that performance is same as for the original tinydb

kaliiiiiiiiii commented 7 months ago

aiotinydb uses:

MrPigss commented 1 month ago

I might take a look at this in the near future. There is a good chance that aiotinydb already has better performance than the original tinydb. The biggest reason the original tinydb is "slow" is that it waits for fileIO on every write. Mitigating this in any way, be it AsyncIO or Threading should improve performance quite a bit.

MrPigss commented 1 month ago

Links for future reference: aiotinydb caio aiofiles aiofile