-
Notifications
You must be signed in to change notification settings - Fork 6
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
Matching performance #33
Comments
Great idea -- we've not seen any noticeable performance penalties after moving to NDS but I think it would be a great little win to cache the results of a match. In general, most styles are created at the beginning of the app's lifetime but the styles can be modified at any point so I guess we'll have some decisions to make regarding invalidation or updating already cached results. |
This was addressed in 46f00dc |
Odd question about that commit (and the stylist in general) - do we care about multithreading, and if so, should we care about this being an actor? |
Hasn't been a problem so far, but probably wouldn't hurt to make it thread safe 🤷 |
#52 ;) |
SwiftUI reloads its view hierarchy a lot. This wasn't a problem when we used the previous matching scheme because all the heavy lifting was done when a style was added, not when a style was requested.
With NDS, we can't take any shortcuts when we add a style so all the matching has to be done when a style is requested - and the matching is heavier than before as we have to compare every style and sort, whereas previously we just found the first match and used it.
Are we concerned about matching performance? If so, should we add in some sort of matching cache so we don't recalculate matching scores for identifier pairs we have matched before.
Minimum, should we add in some metrics so we can at least know what effect matching is having (i.e. metrics like total matches, total time spent matching, average time per match etc)? If we do this, we might find out that I'm worrying over nothing :)
The text was updated successfully, but these errors were encountered: