califyn / time-cord

A Python library for Discord time management tools
MIT License
0 stars 5 forks source link

Faster file writing for database #13

Open califyn opened 4 years ago

califyn commented 4 years ago

Currently, the way that new logs are written to records.log is very slow, especially if records.log grows to a large size. Right now, inside run.py, the function rec_write() starts from the beginning of the file, looks for the line where the new entry should be inserted from the beginning and ends up rewriting the entire file. This will probably be very slow if records.log grows to a large size, so instead it would be better to start from the end and work backwards without rewriting the whole file.

califyn commented 4 years ago

Also, a similar problem in insights.py in the update() method.