-
Notifications
You must be signed in to change notification settings - Fork 55
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
Improve perception performance #24
Conversation
struct FeatureView: View { | ||
let model = Model() | ||
var body: some View { | ||
Text(self.model.count.description) | ||
Text(expectRuntimeWarning { self.model.count }.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.
Updated tests so that we can be very specific about exactly where the runtime warning is triggered. Before we were only testing that a warning was triggered somewhere or not at all.
@mbrandonw Can you tell me how to use that warning message to debug my perception? I just print the file and line with the warning message and it gave me "PerceptionRegister.swift", 124 to me where your method is in. |
Hi @SongJiyeon, I'm not sure I understand the question. Can you start a discussion and provide more details? |
We now cache the result of perception checking by the file/line where the registrar's
access
is called, but we only cache if it'strue
so that we do not need to check again if a warning has already been displayed. We do not cache if it'sfalse
so that we can check again next time, just in case the access is happening from a different view.