- Notifications
You must be signed in to change notification settings - Fork524
Add test example for double equatable check#259
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Having a default implementation for `skipRepeats` when the selected state is equatable causes what could be a performance issue when the user implements their own `skipRepeats`.The original default implementation is still called, even though a default exists.This could also cause unwanted behaviour if the custom skipRepeats wants to compare something not checked in the default equatable.
ReSwiftTests/TestFakes.swift Outdated
| varvalue:Int=0 | ||
| varcustomEquatCount:Int=0 | ||
| staticfunc==(left:CustomEquatable, right:CustomEquatable)->Bool{ |
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.
Operator Function Whitespace Violation: Operators should be surrounded by a single whitespace when defining them. (operator_whitespace)
This intentionally fails to demonstrate what may be undesirable behaviour. |
DivineDominion commentedNov 19, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I swear we had a user report confusion about this somewhere, recently. Cannot find the issue, though. It does not make sense to
I think something among the lines of a Then more expressibe types can aid; the general Writing it down like this makes me realize we are operating on types called "subscription", which conveys the connection to the store is already established but subsequently modified. What about renaming the stuff we call I'd like to help cook something like this up if it resonates with you. I propose we pick this issue up one way or another, and@mjarvis what do you think about a title like "[WIP] Avoid multiple calls to skipRepeats for substates" or something? |
@DivineDominion I gave this a try a while back but was unable to resolve the problem. You're welcome to take a crack at it. |
AlexanderBollbach commentedJun 5, 2018 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
so i ran into this issue and incurred performance hits in my app. i called |
#262 partially resolved this issue by removing automatic skips from sub-state selections, however we still have an issue where the original Store subscription creation creates a skipRepeats which is unnecessary, since we're providing a smaller subset skipRepeats in our explicit subscription.This adjusts the test fake to make our main state Equatable, which surfaces a double skipRepeats issue again.
Having a default implementation for
skipRepeatswhen the selected state is equatable causes what could be a performance issue when the user implements their ownskipRepeats.The original default implementation is still called, even though a default exists.
This could also cause unwanted behaviour if the custom skipRepeats wants to compare something not checked in the default equatable.