Minor dict-based and semaphore-based optimizations#389
Minor dict-based and semaphore-based optimizations#389MarkCiliaVincenti wants to merge 6 commits intoListenarrs:canaryfrom
Conversation
|
Hey @MarkCiliaVincenti Thanks for another PR! I am not a C# expert, obviously, hence this project. Can you help me understand some of the differences here and what we gain from these optimizations? |
|
There were a bunch of changes. Mainly avoiding double dictionary lookups. There were a number of places where we were checking if a key exists and if it does then get its value. That's doing double the work. Also the use of AsyncKeyedLock which you're already depending on ensures that semaphores are both pooled as well as the dictionary cleaned up after use to avoid slow memory leaks. Is there anything in particular that you don't understand well here? |
|
Hey @MarkCiliaVincenti, I'm testing this out now but I wanted to keep you informed that I had to resolve a merge conflict when bringing it up to date with 0.2.56. Also could you provide a PR description so if regression testing goes well I can just approve this PR? Thanks! MC Context: In DownloadMonitorService, your changes were mostly the dictionary/collection cleanup pattern: ContainsKey to TryGetValue, and ContainsKey plus Remove to just Remove. We kept that approach. The conflict there overlapped with later qBittorrent monitoring changes, so I kept the richer current implementation that tracks ratio/seed-limit state and CanMoveFiles / CanBeRemoved, because later logic already depends on that behavior. |
Update version from 0.2.55 to 0.2.56 across the repository. Modified root package.json and package-lock.json, and fe/package.json and fe/package-lock.json to reflect the new release. No other dependency or code changes included; lockfiles updated accordingly.
No description provided.