Skip to content
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

Lists could be faster #388

Open
zadjii opened this issue Feb 1, 2025 · 3 comments
Open

Lists could be faster #388

zadjii opened this issue Feb 1, 2025 · 3 comments
Labels
Area-HostUX UX elements of the host CmdPal application Issue-Feature

Comments

@zadjii
Copy link
Collaborator

zadjii commented Feb 1, 2025

  • What if we didn't pre-fetch all details, only lazy loaded them when needed?
    • The host doesn't need to read that property until it's going to show the details
      • We probably wouldn't do it immediately as needed, but like, 25 items at a time
    • The extension doesn't need to generate that property on creation. It can probably have an LazyDetails( Func<void, IDetails>) : IDetails that only constructs the data when actually read
  • Similar to the above, but with context items
  • EVEN MORE SO: What if we just marked a page as Initialized after the first like, 25 items? so that it's usable even as we're still fetching.
@zadjii zadjii added the Area-HostUX UX elements of the host CmdPal application label Feb 1, 2025
@zadjii
Copy link
Collaborator Author

zadjii commented Feb 1, 2025

Image

@zadjii
Copy link
Collaborator Author

zadjii commented Feb 3, 2025

Just commenting out loading Details dropped it from 48s to 43s. That could just be noise.

However, dropping MoreCommands for each of these icons changed it down to 15s. That's crazy faster.

@zadjii
Copy link
Collaborator Author

zadjii commented Feb 4, 2025

Huh, a thought:

ListItemViewModel evaluates equivalency on the WinRT objects themselves. I bet:

  • we could return 25 more each time FetchItems is called
  • Don't InitializeProperties immediately, just stick the uninitialized viewmodel in the list
  • then InPlaceUpdateList:
    • the new items will get added to the list
    • the old items (in the same place) won't be touched
    • [[acceptable]] old items in new places will be uninitialized
  • then kick off a thread to start initializing them

then even if we LoadMore and fetch the same 25+25 more, we won't try to re-init the original ones

(probably not the same as just "don't pre-fetch MoreCommands et al" but just another thought)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-HostUX UX elements of the host CmdPal application Issue-Feature
Projects
None yet
Development

No branches or pull requests

2 participants