Improve file cache performance and add migration

LibraryCommands.GetCounts hits the file cache hard. The previous cache implementation was linear list, so finding an entry by ID was (n). When you consider that each book may have many files, the number of cache entries could grow to many multiples of the library size.

The new cache uses a dictionary with the ID as its key, and a CacheEntry list as its value.
This commit is contained in:
MBucari 2025-02-28 01:06:54 -07:00 committed by Michael Bucari-Tovo
parent 47c9fcb883
commit a9375f1520
3 changed files with 191 additions and 65 deletions

View file

@ -11,6 +11,7 @@ namespace LibationFileManager
{
private static Dictionary<string, FileType> dic => new()
{
["aax"] = FileType.AAXC,
["aaxc"] = FileType.AAXC,
["cue"] = FileType.Cue,
["pdf"] = FileType.PDF,