-
Notifications
You must be signed in to change notification settings - Fork 0
Conversation
// We have already parsed the whole document as Subtext but | ||
// as part of rendering we will re-parse each block again. | ||
|
||
// This has a significant cost in list views. | ||
Self.renderer.render(renderable.block.description) |
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.
Need to rethink this rendering approach at some point.
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.
Could we change the API here to take a Subtext instance instead? https://github.com/subconsciousnetwork/subconscious/blob/main/xcode/Subconscious/Shared/Parsers/SubtextAttributedStringRenderer.swift#L151
colorScheme == .dark ? DeckTheme.darkBg : DeckTheme.lightBg | ||
) | ||
var body: some View { | ||
(colorScheme == .dark ? DeckTheme.darkBg : DeckTheme.lightBg) |
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.
It doesn't seem like much, but directly rendering a LinearGradient
as a view vs. using it as a background on a frame has a massively reduced rendering cost.
27624bf
to
6ff6be7
Compare
9359c71
to
ab96c0d
Compare
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
@@ -87,7 +87,6 @@ struct AppView: View { | |||
.onChange(of: self.scenePhase) { phase in | |||
store.send(.scenePhaseChange(phase)) | |||
} | |||
.sentryTrace("AppView") |
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.
Too expensive?
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.
Too expensive and not actually useful without forking out more money to sentry.
.onAppear { | ||
selectedTab = store.state.selectedAppTab | ||
} | ||
.onChange(of: selectedTab) { v 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.
Note: on iOS 17 we'll need to update this to
.onChange(of: selectedTab) { _, v in
// ...
}
// We have already parsed the whole document as Subtext but | ||
// as part of rendering we will re-parse each block again. | ||
|
||
// This has a significant cost in list views. | ||
Self.renderer.render(renderable.block.description) |
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.
Could we change the API here to take a Subtext instance instead? https://github.com/subconsciousnetwork/subconscious/blob/main/xcode/Subconscious/Shared/Parsers/SubtextAttributedStringRenderer.swift#L151
ee0a142
to
6b72afe
Compare
Before
After (No Hangs!)