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
[CIS-638] Decrease channel launch times #802
Conversation
a5230f6
to
8fba814
Compare
if object.changedValues().isEmpty { | ||
self.writableContext.refresh(object, mergeChanges: 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.
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 that's ⬆️ the case, we definitely don't need that persisted hash workaround, this would be a much cleaner one.
Also, the existence of this PR proves that #752 did not resolve the issue fully.
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.
Basically yes. hasChanges
is just dirty flag, so whenever you touch object, it gets marked as with changes.
changedValues
contains pairs of keys-values of actually changed values.
Here exist additional property hasPersistentChangedValues
that should work as you would expect from hasChanges
, but documentation is lucking, so I went with current solution
8fba814
to
6c1731b
Compare
Codecov Report
@@ Coverage Diff @@
## main #802 +/- ##
==========================================
+ Coverage 88.45% 88.48% +0.02%
==========================================
Files 220 220
Lines 8611 8632 +21
==========================================
+ Hits 7617 7638 +21
Misses 994 994
Continue to review full report at Codecov.
|
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.
Looking good, I have mostly nit comments. One thing I don't understand is
How come this change is not removed by df7983b ?
6c1731b
to
c64a272
Compare
@ManWithBear All right, let's merge this! |
Average channel open time (duration from tap to idle state) is 1.3s.
A lot of time takes data base updates and table reloads.
But in most cases such reloads are redundant because object haven;t been changed, only touched and marked as dirty.
By reseting dirty, but not changed, objects I was able to reduce open time from 1.3s to 0.6s.
Rest of time is initial layout setup (VC and message list). It doesn't make much sense to invest time in this, since layout policy is about to change.