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

Optimization needed #4

Closed
dkk opened this issue Jun 21, 2021 · 4 comments
Closed

Optimization needed #4

dkk opened this issue Jun 21, 2021 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@dkk
Copy link
Owner

dkk commented Jun 21, 2021

When drawing many items, for example with something like:

WrappingHStack(1...50) {
    Text("Item: \($0)")
}

it takes way too long to draw.

@dkk dkk added enhancement New feature or request help wanted Extra attention is needed labels Jun 21, 2021
@scottostler
Copy link

@dkk one optimization I found helpful was to store the result of InternalWrappingHStack.firstItemOfEachLane so it's only computed once – that made the difference in being able to use this for an interactive UI with about 20 items

if you'd like I can open a PR, it's a very small change: scottostler@4c74430

thanks for providing this library btw, it was just what I needed for a collection of pill buttons

@dkk
Copy link
Owner Author

dkk commented Jul 18, 2021

Thanks a lot. Yes, please open that PR. I'm on holidays right now, but I'll try it out as soon as I'm back.

@dkk
Copy link
Owner Author

dkk commented Jul 28, 2021

Included in release 2.1.2. I'm leaving this issue open since I still would like to write performance tests & maybe take a look if I can improve WrappingHSTack some more.

dkk added a commit that referenced this issue Dec 3, 2022
@dkk
Copy link
Owner Author

dkk commented Dec 3, 2022

Fixed at version 2.2.8

@dkk dkk closed this as completed Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants