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

chore: Avoid re-render from states value change #5466

Merged
merged 9 commits into from
Jan 11, 2021

Conversation

zhixzhan
Copy link
Contributor

@zhixzhan zhixzhan commented Jan 7, 2021

Description

Some components consume too much unnecessary states which can cause itself re-render. By reducing them can avoid re-render.

  1. Reduce states in ProjectRouter components
  2. Reduce states in LGPage/LUPage/QnAPage components, and avoid submit unchanged value.

Task Item

refs #5396

Screenshots

Inline editing on LG all up view table-list:
image

Before (several re-render):
image

After (one render):
image

@boydc2014
Copy link
Contributor

Looks good, can you list how much time is saved?

@coveralls
Copy link

coveralls commented Jan 7, 2021

Coverage Status

Coverage increased (+0.04%) to 54.824% when pulling a413888 on zhixzhan/perf-code-review into 9e1f515 on main.

@zhixzhan zhixzhan marked this pull request as ready for review January 11, 2021 08:11
@zhixzhan
Copy link
Contributor Author

Looks good, can you list how much time is saved?

Number of render times has been reduced from 2 to 1, it should save 50% render UI time.

@boydc2014 boydc2014 merged commit 3376d28 into main Jan 11, 2021
@boydc2014 boydc2014 deleted the zhixzhan/perf-code-review branch January 11, 2021 12:50
lei9444 pushed a commit to lei9444/BotFramework-Composer-1 that referenced this pull request Jun 15, 2021
* consume less state to avoid re-render

* avoid submit no change

* consume less states in project router

* types clean up

* update

* lint

Co-authored-by: Dong Lei <donglei@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants