Skip to content

[perf] Update redux store with only the values that changed#5594

Merged
SatishGandham merged 15 commits intoreleasefrom
selectively-update-redux-store
Jul 20, 2021
Merged

[perf] Update redux store with only the values that changed#5594
SatishGandham merged 15 commits intoreleasefrom
selectively-update-redux-store

Conversation

@SatishGandham
Copy link
Contributor

@SatishGandham SatishGandham commented Jul 5, 2021

Description

Earlier we used to replace the entire evaluated value in the redux store, now we selectively update only what have changed.
This change prevents unnecessary re-renders of the widgets.

Fixes #5567

Type of change

  • Performance optimisation

How Has This Been Tested?

Profiled before and after. Only modified widget is re-rendered.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Test coverage results 🧪

🔴 Total coverage has decreased
// Code coverage diff between base branch:release and head branch: selectively-update-redux-store 
Status File % Stmts % Branch % Funcs % Lines
🔴 total 53.58 (-0.01) 35.32 (-0.01) 32.13 (0.01) 54.14 (0)
🔴 app/client/src/reducers/evaluationReducers/treeReducer.ts 36.84 (-48.87) 0 (-100) 50 (0) 50 (-35.71)
🟢 app/client/src/sagas/EvaluationsSaga.ts 17.11 (0.08) 1.01 (0.02) 3.23 (0.1) 20 (0.2)
🔴 app/client/src/workers/DataTreeEvaluator.ts 88.7 (0.2) 78.01 (-0.16) 87.14 (-0.18) 88.57 (-0.1)
🟢 app/client/src/workers/evaluationUtils.ts 86.89 (-0.07) 71.97 (0.2) 87.5 (0.27) 86.73 (0.49)

@SatishGandham SatishGandham requested review from hetunandu and riodeuno and removed request for riodeuno July 5, 2021 08:52
@SatishGandham
Copy link
Contributor Author

/ok-to-test sha=72dc508

@SatishGandham
Copy link
Contributor Author

/ok-to-test sha=f3ccb70

@SatishGandham
Copy link
Contributor Author

/ok-to-test sha=08aa224

@SatishGandham
Copy link
Contributor Author

/ok-to-test sha=4d3d23d

@SatishGandham
Copy link
Contributor Author

/ok-to-test sha=5996b1b

@SatishGandham
Copy link
Contributor Author

/ok-to-test sha=ba51bd2

@SatishGandham
Copy link
Contributor Author

/ok-to-test sha=af8b872

@SatishGandham SatishGandham changed the title Update redux store with only the values that changed [perf] Update redux store with only the values that changed Jul 16, 2021
@SatishGandham
Copy link
Contributor Author

/ok-to-test sha=89533e2

somangshu
somangshu previously approved these changes Jul 16, 2021
Copy link
Contributor

@somangshu somangshu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to run tests

@SatishGandham
Copy link
Contributor Author

/ok-to-test sha=2a0b816

Copy link
Contributor

@somangshu somangshu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving to run tests

@SatishGandham
Copy link
Contributor Author

/ok-to-test sha=1dc5963

Copy link
Contributor

@riodeuno riodeuno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving for tests

@SatishGandham SatishGandham merged commit fb78233 into release Jul 20, 2021
@SatishGandham SatishGandham deleted the selectively-update-redux-store branch July 20, 2021 05:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Selectively update the redux store upon receiving the evaluations to prevent whole canvas from re-rendering.

4 participants