-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[Checkbox] Major performance problems #2832
Comments
@fignuts Thanks for raising this issue. I strongly convinced that we should switch ⚡ from the float layout to the flexbox layout model.
The best part is that it should be straightforward to change. Easy task for great output 😁. |
This can be easily reproduced with the table component (http://www.material-ui.com/#/components/table). In addition to rendering time for the table with checkboxes, the table selection behaviour (i.e. checking the checkbox behaviour) would take around 4 seconds to complete with 501 rows table. This was on Intel 3GHz 4 core machine with latest Chrome. Suggest to verify the performance fix along with the table component for the best result. |
I see a similar issue with
I'd say that on most of my pages that ~70% of wasted time is from some MUI component. |
@aweary We are moving towards more functional programming. Soon we will be able to memoize the styles, that will drastically reduce the number of instantiations. |
Experiencing the same problem but at a much larger scale. I have more than 1200 rows in a table with a Checkbox to select them. There is 21 seconds (!) wasted in the Checkbox. The time wasted seems to be exponential to the number of checkboxes. |
Also ran into this issue and have had to remove checkboxes for the moment. Was only using 8 on the page at the time but the component containing the checkbox has to rerender every 2.5-5 seconds based on DB updates so was getting a noticeable fps drop every re-render. |
Any news regarding this issue? |
Just to share my findings on the subject, I've conducted a test using a table of 100 rows and 10 columns, once with checkboxes and one other time without them. Of course presence of checkboxes made it slower but even without them the performance needed a boost. In my test, using Chrome's Timeline, selecting a row with presence of the checkboxes resulted in 450ms while without them the same action took 150ms. Of course it's still too much. I'm not sure how to do a more precise measurement as the row selection is an internal operation and there's no place to put Perf.start and Perf.stop! In any case I'm grateful for the great work, thanks. |
Hey guys - Really interesting insight into the problem in these discussions. We're running into the same problems with checkboxes as the rest. Is it possible to get an update on any work towards improvements in this area? |
I had a similar problem and I fixed it by making each checkbox 'pure' with recompose: import makePure from 'recompose/pure'
import Checkbox from 'material-ui/Checkbox'
const FasterCheckbox = makePure(Checkbox) This wraps |
@gmaclennan Thanks for sharing! Unfortunately it doesn't seem to make a difference when creating a "large" amount of checkbox components (40-50) |
I believe, this issue should be closed in favor of #3289. |
Hey, |
I'm using the example provided from the Demo and I produce 143 RadioButton and it seem still slow [Violation] 'click' handler took 169ms So I'm wonder if the CheckBox fixs work for the RadioButton? Thanks |
@tietthinh You can follow the discussion in #10892. |
I am using 36 checkboxes and seeing degradation onclick that spans seconds though I do have some processing going on beneath its a bit unusual using latest material 2 angular 8 |
@nhhockeyplayer We only support React. |
Checkboxes are VERY slow. I have a list of 50 items each each with 2 checkboxes, making a total of 100 checkboxes. This takes almost a second to render on a 4.2ghz i7 in the latest chrome.
The top two entries from Perf.printWasted() when rendering this list
If I remove the two material ui checkboxes and replace them with normal inputs rendering time drops from over 700ms to around 70ms. The material checkboxes make rendering this list 10x slower!
The text was updated successfully, but these errors were encountered: