material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[SelectField][Dropdown Menu] Menu with many items performance much worse with popovers

Open tehleach opened this issue 10 years ago • 33 comments

I was using a SelectField before the changes related to popovers (release 0.14.0-rc2). The menu has about 400 items to choose from. Before, expanding and collapsing the menu was very fast (almost instant) but with the popover change it is quite slow (.5-1 second). I have verified that this performance change happened in 0.14.0-rc2 by switching back and forth between that and 0.14.0-rc1, and observe fast expand/collapse in rc1 but slow expand/collapse in rc2. Has anyone else noticed a similar performance hit? Was there any testing done with large lists of menuItems?

It's a bummer because the popover is giving us lots of nice features (such as actually being able to scroll through the menu items :) ) we were looking for but as is, we cannot use it.

tehleach avatar Jan 04 '16 23:01 tehleach

@tehleach After code quality and documentation, performances are the next point I want to take care of. That's worrying. Could we have a gif of what's happening? Or do I just need to render 400 simple items?

oliviertassinari avatar Jan 04 '16 23:01 oliviertassinari

I don't think I can give you a gif. I would assume rendering 400 simple items would do the trick, but I'm looking at the example on the docs site with 100 items and it seems quick. It might have to do with having long primaryText strings? I can do some more thorough testing in a bit.

tehleach avatar Jan 04 '16 23:01 tehleach

Ok, here's a quick project I threw together.. pretty bare bones. I'm just rendering a DropDownMenu component with 400 items. It's possible I'm doing something really stupid but I am still having the same performance issue. If anyone pulls it down and runs it, let me know if you run into any issues. I'd like to look into and try to improve the performance but I'm not sure when I'll have time to.

tehleach avatar Jan 05 '16 22:01 tehleach

I have same performance issue.My SelectField have about 500 items and it's very very slowly(2-3 second) when expanding and collapsing.I try to increase items number from 100 to 500 and then the SelectField's performance exponential decrease.

Yuliang-Lee avatar Jan 20 '16 06:01 Yuliang-Lee

I had a similar experience but also have some spots in my app with several SelectFields of 10-20 items - even thought the list of items is short the performance seems to slow exponentially depending on how many total select fields are rendered on the page at any given time.

Shearerbeard avatar Jan 22 '16 18:01 Shearerbeard

I have the same performance issue on all these elements :

  • List
  • SelectField
  • Autocomplete

Maybe using something like https://github.com/bvaughn/react-virtualized would be the solution ?

jgoux avatar Feb 17 '16 18:02 jgoux

react-virtualized author here. I think that implementing windowing by default within components that may potentially contain a lot of data (like selects) is a great idea. If you'd be interested in discussing a possible integration, @oliviertassinari, please reach out to me.

bvaughn avatar Mar 07 '16 18:03 bvaughn

@bvaughn The Material-UI team is definitely interested in this integration. We are glad you are willing to help :+1:.

oliviertassinari avatar Mar 07 '16 21:03 oliviertassinari

Let's talk more then. Let me know how best to do that. (Email? Hangout? Discord?)

bvaughn avatar Mar 07 '16 21:03 bvaughn

@oliviertassinari This seems like there may be quite a bit of work/time before this is resolved. Do we need it for 0.15.0 or can we move it?

nathanmarks avatar Mar 08 '16 13:03 nathanmarks

@nathanmarks That would be better to have into 0.15.0 but I don't think that this issues requires to introduce any breaking changes. I don't have time to have a look at it. I have just removed it from the 0.15.0 milestone.

oliviertassinari avatar Mar 08 '16 14:03 oliviertassinari

I have this performance problem with the AutoComplete with 500 records :(

Is there any workaround when its not fixed yet?

Thanx

marcelobateira avatar Mar 18 '16 17:03 marcelobateira

@marcelobateira We have merged a first PR that improve the rendering by 20%. I'm pretty sure we can do much better.

oliviertassinari avatar Mar 18 '16 18:03 oliviertassinari

same problem here with ~250 items using material-ui 0.15. any news about the fix?

keown avatar May 31 '16 17:05 keown

Also having performance issues with dropdown

ColeMurray avatar May 31 '16 19:05 ColeMurray

Still happy to lend a hand with react-virtualized integration if there's still interest and things have progressed far enough to work on it. (I think last time we talked there was some refactoring work in the queue that you guys wanted to do first.)

bvaughn avatar May 31 '16 19:05 bvaughn

We implemented this using react-virtualized, though it's been modified for our uses without regard for back compat so it's not easy to merge back upstream. It works great! https://github.com/mitodl/micromasters/pull/568

noisecapella avatar Jun 23 '16 16:06 noisecapella

though it's been modified for our uses

@noisecapella: "it" being react-virtualized or material-ui?

bvaughn avatar Jun 23 '16 16:06 bvaughn

Material-UI from what I have seen.

oliviertassinari avatar Jun 23 '16 17:06 oliviertassinari

Ah, yeah. They forked List and Menu. Should have looked before asking. Haven't had ☕ yet. 😄

If react-virtualized needed to be forked I was going to ask if I could help merge the changes back into the mainline. B'c I think getting material-ui and react-virtualized working together would be great. But since it's a fork of your guy's component... your call I guess. Still happy to help if there's anything I can help with!

bvaughn avatar Jun 23 '16 17:06 bvaughn