mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Merge branch 'mkirk/perf-tweaks'
This commit is contained in:
commit
7245307c92
|
@ -222,17 +222,11 @@ const CGFloat kMaxTextViewHeight = 98;
|
||||||
// Momentarily switch to a non-default keyboard, else reloadInputViews
|
// Momentarily switch to a non-default keyboard, else reloadInputViews
|
||||||
// will not affect the displayed keyboard. In practice this isn't perceptable to the user.
|
// will not affect the displayed keyboard. In practice this isn't perceptable to the user.
|
||||||
// The alternative would be to dismiss-and-pop the keyboard, but that can cause a more pronounced animation.
|
// The alternative would be to dismiss-and-pop the keyboard, but that can cause a more pronounced animation.
|
||||||
//
|
self.inputTextView.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
|
||||||
// This is surprisingly expensive (~5ms), so we do it async, *after* the message is rendered.
|
[self.inputTextView reloadInputViews];
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
|
||||||
[BenchManager benchWithTitle:@"toggleDefaultKeyboard" block:^{
|
|
||||||
self.inputTextView.keyboardType = UIKeyboardTypeNumbersAndPunctuation;
|
|
||||||
[self.inputTextView reloadInputViews];
|
|
||||||
|
|
||||||
self.inputTextView.keyboardType = UIKeyboardTypeDefault;
|
self.inputTextView.keyboardType = UIKeyboardTypeDefault;
|
||||||
[self.inputTextView reloadInputViews];
|
[self.inputTextView reloadInputViews];
|
||||||
}];
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setQuotedReply:(nullable OWSQuotedReplyModel *)quotedReply
|
- (void)setQuotedReply:(nullable OWSQuotedReplyModel *)quotedReply
|
||||||
|
|
|
@ -3898,10 +3898,21 @@ typedef enum : NSUInteger {
|
||||||
|
|
||||||
[self messageWasSent:message];
|
[self messageWasSent:message];
|
||||||
|
|
||||||
if (updateKeyboardState) {
|
|
||||||
[self.inputToolbar toggleDefaultKeyboard];
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
}
|
[BenchManager benchWithTitle:@"toggleDefaultKeyboard"
|
||||||
[self.inputToolbar clearTextMessageAnimated:YES];
|
block:^{
|
||||||
|
if (updateKeyboardState) {
|
||||||
|
[self.inputToolbar toggleDefaultKeyboard];
|
||||||
|
}
|
||||||
|
}];
|
||||||
|
|
||||||
|
[BenchManager benchWithTitle:@"clearTextMessageAnimated"
|
||||||
|
block:^{
|
||||||
|
[self.inputToolbar clearTextMessageAnimated:YES];
|
||||||
|
}];
|
||||||
|
});
|
||||||
|
|
||||||
[self clearDraft];
|
[self clearDraft];
|
||||||
if (didAddToProfileWhitelist) {
|
if (didAddToProfileWhitelist) {
|
||||||
[self.conversationViewModel ensureDynamicInteractions];
|
[self.conversationViewModel ensureDynamicInteractions];
|
||||||
|
|
|
@ -18,7 +18,8 @@ public func BenchAsync(title: String, block: (@escaping () -> Void) -> Void) {
|
||||||
|
|
||||||
block {
|
block {
|
||||||
let timeElapsed = CFAbsoluteTimeGetCurrent() - startTime
|
let timeElapsed = CFAbsoluteTimeGetCurrent() - startTime
|
||||||
Logger.debug("[Bench] title: \(title), duration: \(timeElapsed)")
|
let formattedTime = String(format: "%0.2fms", timeElapsed * 1000)
|
||||||
|
Logger.debug("[Bench] title: \(title), duration: \(formattedTime)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue