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

very slow?

Open chuchengcao opened this issue 11 years ago • 8 comments

my page contains 30 forms, each form contains 10 TextFields and 5 FlatButtons, setState(cause render) will cost 10 seconds

chuchengcao avatar Jul 09 '15 04:07 chuchengcao

@chuchengcao Are your forms all inside the same component?

export default class extends React.Component {
  render() {
    return (
      <form id="form1">
        <TextField ... />
        <TextField ... />
        ...
      </form>
      <form id="form2">
        <TextField ... />
        <TextField ... />
        ...
      </form>
      ...
    );
  }
}

jkruder avatar Jul 09 '15 14:07 jkruder

This is probably related to #1040

chrismcv avatar Jul 09 '15 21:07 chrismcv

@jkruder Yes. Actually it is like this :

class Form extends React.Component{
 render() {
    return (
      <form>
        <TextField ... />
        <TextField ... />
        <DatePicker ... />
        ...
      </form>
}

class XXForms extends React.Component {
  render() {
    return (
      <div>
        <Form ... />
        <Form ... />
        <Form .../>
        ...
      </div>
    );
  }
}

when I profiling it, i found that "DatePicker" cost about 70% cpu time. And when I use another DatePicker which is not from material-ui, render time reduce to 3s.

chuchengcao avatar Jul 10 '15 07:07 chuchengcao

Witch version of material-ui are you using ? In the 0.10 I fixed the datepicker performances problem #1059. Can you confirm this with the new release ?

oliviertassinari avatar Jul 10 '15 07:07 oliviertassinari

@oliviertassinari , Thank you for replay. My version is 0.9.1, I think it is the same problem. I will confirm it.

chuchengcao avatar Jul 10 '15 07:07 chuchengcao

@oliviertassinari I confirmed that performance problem is solved in 0.10.0. :)

chuchengcao avatar Jul 10 '15 08:07 chuchengcao

Perfect :smiley:

oliviertassinari avatar Jul 10 '15 08:07 oliviertassinari

Can you close the issue then?

oliviertassinari avatar Jul 10 '15 08:07 oliviertassinari