Closed SamuelBMartins closed 1 week ago
This is a continuation of the PR #2840.
This time I used an ConcurrentDictionary<int, SemaphoreSlim>
so that every chapter uses a different Semaphore. The dictionary keeps every Semaphore ever used in memory since the semaphore is needed not only for creating the cache but also checking if the cache exists in successive request. I have another branch bugfix/concurrent-extraction2-2 where I try to keep the number of entries in the dictionary low. However, I'm not sure this alternative is better since for each page requested, even if already cached, I need to create a new semaphore.
@majora2007 Can you check if you notice a slowdown with this solution? If there are some automated benchmarks I can run them myself.
Hey, sorry haven't gotten around to this. Been pretty swamped irl. There is another PR from Robbie with reader changes. Going to combine these and deploy them to my prod instance to give a good shakeout this week.
Looking good so far, nothing stood out. I yet again manually merged this into another branch that will be merged, then I will close this PR.
This was merged here: https://github.com/Kareadita/Kavita/pull/2960
Fixed