For each add_stats() call, there's a linear search through a single linked list, followed by a save of the stats file. A binary search, or perhaps a tree of some sort would be better, and perhaps deferring the file save until a timer tick or something?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
For each add_stats() call, there's a linear search through a single linked list, followed by a save of the stats file. A binary search, or perhaps a tree of some sort would be better, and perhaps deferring the file save until a timer tick or something?