Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

czgu
Copy link
Collaborator

@czgu czgu commented Mar 24, 2021

This PR mainly addresses #433

  • Use pure components/React.memo to reduce unnecessary component render.
  • Updated reselect selectors with make selector to ensure they are properly memorized.
  • Put useCallback instead of arrow func and .bind to minimize unnecessary prop update.
  • Also solves the issue with wrong data doc cell being deleted due to useCallback memo DataDoc's edits are not being saved correctly #434

Benchmark:

Test 1

Large datadoc with ~30 query cells. Ensure they are all rendered and start typing in 1 cell with keystrokes of 5hz. Measured using React profiler:

worst case render time:
Before ~150ms
After: ~6ms

Test 2

Fully rendered the said doc above, click on the first four cells sequentially:
worse case render time:
before: ~160ms
after: ~11ms

@czgu czgu requested a review from meowcodes March 24, 2021 07:14
@czgu czgu linked an issue Mar 24, 2021 that may be closed by this pull request
@czgu czgu linked an issue Mar 24, 2021 that may be closed by this pull request
@czgu czgu merged commit 65e39fc into master Mar 25, 2021
@czgu czgu deleted the optimization branch March 25, 2021 00:19
rohan-sh1 pushed a commit to CAI-TECHNOLOGIES/cai-ext-db-explorer that referenced this pull request Feb 28, 2023
* refactor: reduce component re-render

* disable wdyr in testing

* ts fix and added memo for table of contents

* fixed typescript issues

* resolved comments
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.

DataDoc's edits are not being saved correctly Large DataDoc Performance Issue
2 participants