简体   繁体   English

React Redux应用程序缓慢

[英]Slowness in react redux application

I am facing issues with performance of my application. 我遇到了我的应用程序性能问题。 I have some component like below. 我有一些像下面的组件。 I added some console times to dig deep into the possible issue and these are the findings. 我添加了一些控制台时间来深入研究可能的问题,这些是发现的结果。

GridRenderTime ~ 2-5 ms GridRenderTime〜2-5毫秒

GridRenderOverallTime ~ 5 seconds GridRenderOverallTime〜5秒

Huge difference. 差异很大。 I am not sure what else processing is happening between componentWillUpdate and componentDidUpdate that is not getting captured by metric "GridRenderTime". 我不确定componentWillUpdate和componentDidUpdate之间还没有进行其他处理,而该处理未通过度量“ GridRenderTime”捕获。

export default class Grid extends Component {

     componentWillUpdate() {
        console.time('GridRenderOverallTime');
     }

     componentDidUpdate() {
        console.timeEnd('GridRenderOverallTime');
     }

     render() {
         return (
           <div>
              {console.time('GridRenderTime')}
              <BulkActionPanel
                  actions={this.bulkActions}
                  selectedJobIds={this.getFromConfig(this.props.config, [SELECTED_ROWS_PATH_IN_GRID_CONFIG])}
             />
              <SlickGrid
                  data={this.props.jobGridData}
              />
              <UserInputModal />
              <ActionConfirmationModal />
              <ConfigModal />
              <ChangeChkptStatusModal />
              <ResponseModal />
              <CommandModalBox />
              {console.timeEnd('GridRenderTime')}
          </div>
     } }

As the number of rows passed to SlickGrid increases, GridRenderOverallTime increases proportionally. 随着传递给SlickGrid的行数增加,GridRenderOverallTime也成比例地增加。

Leads here are appreciated. 这里的线索表示赞赏。

Thanks! 谢谢!

In Chrome, press Ctrl + Shift + I to open the developer tools window. 在Chrome中,按Ctrl + Shift + I打开开发人员工具窗口。 Then select the Network tab to view network activity. 然后选择“网络”选项卡以查看网络活动。 Next select the Performance tab. 接下来,选择性能选项卡。 Follow the instructions there to get a detailed view of the performance bottlenecks in your page. 请按照此处的说明操作,以详细了解页面中的性能瓶颈。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM