From 5abe73331aec4c5c8b9cadb77fbc6261f72319db Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 13 May 2019 21:42:47 -0700 Subject: [PATCH 1/5] Make TimelineTableView and TimelineTableRowView opaque in the interest of speeding up rendering during scrolling. --- Mac/MainWindow/Timeline/TimelineTableRowView.swift | 4 ++++ Mac/MainWindow/Timeline/TimelineTableView.swift | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/Mac/MainWindow/Timeline/TimelineTableRowView.swift b/Mac/MainWindow/Timeline/TimelineTableRowView.swift index 692f0a19c..162fb0681 100644 --- a/Mac/MainWindow/Timeline/TimelineTableRowView.swift +++ b/Mac/MainWindow/Timeline/TimelineTableRowView.swift @@ -10,6 +10,10 @@ import AppKit class TimelineTableRowView : NSTableRowView { + override var isOpaque: Bool { + return true + } + init() { super.init(frame: NSRect.zero) } diff --git a/Mac/MainWindow/Timeline/TimelineTableView.swift b/Mac/MainWindow/Timeline/TimelineTableView.swift index 9d83b3778..fb3639134 100644 --- a/Mac/MainWindow/Timeline/TimelineTableView.swift +++ b/Mac/MainWindow/Timeline/TimelineTableView.swift @@ -24,6 +24,10 @@ class TimelineTableView: NSTableView { // MARK: - NSView + override var isOpaque: Bool { + return true + } + override func viewWillStartLiveResize() { if let scrollView = self.enclosingScrollView { scrollView.hasVerticalScroller = false From 7c78d914be86e57630185d913de00fab90743eff Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 13 May 2019 22:06:03 -0700 Subject: [PATCH 2/5] Speed up timeline scrolling by only going up to 150 characters with summary calculation. --- Shared/Timeline/TimelineStringFormatter.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shared/Timeline/TimelineStringFormatter.swift b/Shared/Timeline/TimelineStringFormatter.swift index 681379bf3..2f4503cfe 100644 --- a/Shared/Timeline/TimelineStringFormatter.swift +++ b/Shared/Timeline/TimelineStringFormatter.swift @@ -89,7 +89,7 @@ struct TimelineStringFormatter { return cachedBody } var s = body.rsparser_stringByDecodingHTMLEntities() - s = s.rs_string(byStrippingHTML: 300) + s = s.rs_string(byStrippingHTML: 150) s = s.rs_stringByTrimmingWhitespace() s = s.rs_stringWithCollapsedWhitespace() if s == "Comments" { // Hacker News. From 7b40ca221bdd791e048f4907eaec9a754ce04f9e Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 13 May 2019 22:16:44 -0700 Subject: [PATCH 3/5] Use the articleID + accountID as a key for truncated summaries. This is *way* faster than using the entire body. It avoids a hash of a long string. (Note: we still need to toss the cache at the appropriate time.) --- Shared/Timeline/TimelineStringFormatter.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Shared/Timeline/TimelineStringFormatter.swift b/Shared/Timeline/TimelineStringFormatter.swift index 2f4503cfe..c066ab0d1 100644 --- a/Shared/Timeline/TimelineStringFormatter.swift +++ b/Shared/Timeline/TimelineStringFormatter.swift @@ -85,7 +85,8 @@ struct TimelineStringFormatter { return "" } - if let cachedBody = summaryCache[body] { + let key = article.articleID + article.accountID + if let cachedBody = summaryCache[key] { return cachedBody } var s = body.rsparser_stringByDecodingHTMLEntities() @@ -95,7 +96,7 @@ struct TimelineStringFormatter { if s == "Comments" { // Hacker News. s = "" } - summaryCache[body] = s + summaryCache[key] = s return s } From 51730d9b1c6798408f73de9def2dcc15f7cd1551 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 13 May 2019 22:23:06 -0700 Subject: [PATCH 4/5] =?UTF-8?q?Set=20scaling=20to=20.scaleNone=20in=20the?= =?UTF-8?q?=20avatar=20image=20view=20in=20the=20timeline,=20since=20we?= =?UTF-8?q?=E2=80=99re=20pre-scaling=20the=20images.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift b/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift index ae96d608f..a9a116793 100644 --- a/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift +++ b/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift @@ -19,7 +19,7 @@ class TimelineTableCellView: NSTableCellView { private let feedNameView = TimelineTableCellView.singleLineTextField() private lazy var avatarImageView: NSImageView = { - let imageView = TimelineTableCellView.imageView(with: AppImages.genericFeedImage, scaling: .scaleProportionallyDown) + let imageView = TimelineTableCellView.imageView(with: AppImages.genericFeedImage, scaling: .scaleNone) imageView.wantsLayer = true return imageView }() From c752cb9fc6ebe8a10d759d5ae2003a47f756b3d8 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 13 May 2019 22:31:35 -0700 Subject: [PATCH 5/5] Update RSCore. --- submodules/RSCore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/RSCore b/submodules/RSCore index 6ab0683e6..9c268f00e 160000 --- a/submodules/RSCore +++ b/submodules/RSCore @@ -1 +1 @@ -Subproject commit 6ab0683e6d2fb2dc09b5625a7da62459dbc0d9af +Subproject commit 9c268f00e93f758a79dae04dd8f18d27449221b0