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

Minimal selects much slower because of HTML styling #3297

Closed
lognaturel opened this issue Aug 7, 2019 · 4 comments
Closed

Minimal selects much slower because of HTML styling #3297

lognaturel opened this issue Aug 7, 2019 · 4 comments

Comments

@lognaturel
Copy link
Member

Software and hardware versions

Collect v1.23.0

Problem description

Identified by @JohnTheBeloved.

#3204 renders styled options for minimal selects. The additional step of styling each option slows things down significantly because it's done for every option upfront rather than with the RecyclerView-based select implementations when it's done as an option is displayed.

Steps to reproduce the problem

Load a form with hundreds of choices in a select one/multiple question with the minimal appearance.

Expected behavior

Performance is the same or better as in v1.22.0 and prior.

@lognaturel
Copy link
Member Author

This is potentially a bad regression for users that rely on minimal selects from external files so it could be a candidate for a point release.

This was never very fast to begin with because spinners build every option view at once (as opposed to recycling them as with the RecyclerView). I'm not sure how we evaluate how severe this is. @grzesiek2010, what are your measurements of how big the performance hit is?

In the longer term, I think that it would be ideal for minimal selects to use RecyclerView as well. Can we use a custom layout to fake a spinner?

@grzesiek2010
Copy link
Member

what are your measurements of how big the performance hit is?

it depends, I used Android 5 and a form with 100 choices and it was like 0.5s -> 2.2s
but it will work faster on newer devices but also the more choices the slower performance.

In the longer term, I think that it would be ideal for minimal selects to use RecyclerView as well. Can we use a custom layout to fake a spinner?

It might be difficult to do that with both the spinner (select_one) and alert dialog with multiple choices (select-multiple). I think our goal should be to create our own dialog which would use RecyclerView and support both select_one and select_multiple. Then we could even use MediaLayouts in such a dialog supporting images/audios/video.

It would be a bigger change so not for now and that's why I can see two options: to leave it as is or to revert. I'm not sure what's better...

@grzesiek2010
Copy link
Member

Fixed in #3964

@lognaturel
Copy link
Member Author

Nice.

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

No branches or pull requests

2 participants