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

Lazy Finite or Infinite data in Widgets #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GTimothy
Copy link

@GTimothy GTimothy commented Jan 12, 2021

A proposition to allow for lazy finite or infinite data in Widgets as a Wrapper that is indistinguishable from a Vec<Widget>.

I believe it would help with:

  • Both Lazy Finite and Infinite Scrollable
  • Both Lazy Finite and Infinite anything that uses a Vec<Widget>
  • Lower computation cost in both cases: Lazyness => smaller widget lists in
    scope => simpler updates, fewer primitives calculated, simpler/quicker layout calculations.

@GTimothy
Copy link
Author

GTimothy commented Jan 13, 2021

I have started a POC on this and realised wrapping widgets would not work (Vec<Widget>, it is the data that needs to be wrapped.
My POC is complete and works well, I will share it asap.

@cryptoquick
Copy link

Yes, I sometimes get tripped on that too. Component vs Elm Architecture mentality.

I could definitely use this in my own implementation of a sort of an image gallery. I'll link to my demo once I get some subscription stream concurrency bugs for thumbnailing process addressed.

I'd really like to see what you have so I can use it in mine.

@GTimothy
Copy link
Author

GTimothy commented Jan 13, 2021

Here it is : GTimothy/iced_pocs@c5cbb41
No readme.md yet but the example is quite short so I hope it is understandable.

focus the approach on the data rather than widgets.
@GTimothy
Copy link
Author

Made a small simplification of the code in GTimothy/iced_pocs@7112d03

@cryptoquick
Copy link

I checked out your project, @GTimothy , and it looks interesting.

I'm not sure it does exactly as I was expecting it to, but you're working with text. The optimizer in me wants to think of a way to apply Lazy scroll to my image gallery code, which you can find (finally finished) here:

FuzzrNet/Fuzzr#92

However, I'm not sure it's worthwhile. I save a CPU power by not re-encoding thumbnails, and I have really good streaming parallelization for thumbnailing, so it might be challenging to get that to work on top of a lazy scroll. What's more, is that even with a thousand images, it still performs quite well! Iced is incredibly fast.

As such, this feature will probably have limited utility beyond very large data sets, such as ones that are held on a server. However, I may revisit this perspective once people start actually using my project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants