-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor changes to reduce allocations #848
Conversation
public static IDisposable Read(this ReaderWriterLockSlim obj) | ||
{ | ||
//if (BaseSqliteRepository.ThreadSafeMode > 0) | ||
//{ | ||
// return new DummyToken(); | ||
//} | ||
return new WriteLockToken(obj); | ||
return new WriteLockToken(obj); // TODO: fix segfault |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this message should be expanded, something like "fix segfault if using Read/Write lock"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a closer look at the db code and figured out the reason, I'll try and restructure all databases when my current big PRs are in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still this TODO should be either reformulated to be clear or removed altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Bond-009 you got me convinced.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
#if DEBUG | ||
slowThreshold = 250; | ||
slowThreshold = 10; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These values should probably be documented and maybe even put in a central file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before we document them, we should agree on the values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The values make sense to me. It will produce a lot of warnings in DEBUG, but seeing as we want to optimize it anyway, it's fine with me.
@@ -2957,6 +2949,7 @@ private string GetOrderByText(InternalItemsQuery query) | |||
{ | |||
var columnMap = MapOrderByField(i.Item1, query); | |||
var columnAscending = i.Item2 == SortOrder.Ascending; | |||
const bool enableOrderInversion = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is false, the if statement below this can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableOrderInversion
was already always false, it can be removed in another PR
I've been having trouble with Kodi syncing TV Shows and narrowed the issue down to this commit as it works fine prior to this. Trying to sync TV results in a dialog box saying "Something went wrong during the sync. You'll be able to restore progress when restarting Kodi. If the problem persists, please report on the Jellyfin for Kodi forums, with your Kodi log." The message indicates I should restart Kodi but that does not help at all. Tested on both Kodi 18.1 and 17.6. Here is the log from kodi.log when this occurs:
|
Here is some debug data from the Jellyfin for Kodi addon. I know this is not the repository for that, however since this commit broke it please bear with me. This exception occurs in the loop in Here is the value of
And here is the value of
The keys |
I have further narrowed this down to commit 64d5ec1. I can be on HEAD and revert that commit and it works just fine like it use to. I am not familiar with what this PR is trying to accomplish and am having difficulty understanding the changes. Perhaps someone more familiar with it could chime in with why this is happening? |
I have found the issue. In file |
@Lynxy thanks for the debugging and finding the root cause! |
Reduces stress on the GC