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

Reduce wasted render for activities #2710

Merged
merged 5 commits into from
Dec 12, 2019
Merged

Conversation

compulim
Copy link
Contributor

Fixes #2709.

Changelog Entry

Fixed

  • Fixes #2709. Reduce wasted render of activities by memoizing partial result of <BasicTranscript>, in PR #2710

Description

Add a new useMemoArrayMap hook for. It works like Array.map but also memoizing partial result from the mapper. The resultant array is a new one, but items in it will be memoized as needed.

If the mapper function changed, all memoized result will be invalidated.

Specific Changes

  • Added useMemoArrayMap.js hook for memoizing partial result for Array.map.
  • Updated BasicTranscript.js to use useMemoArrayMap for the first-pass of render.

  • Testing Added

Copy link
Contributor

@tdurnford tdurnford left a comment

Choose a reason for hiding this comment

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

lgtm

@coveralls
Copy link

Coverage Status

Coverage increased (+0.1%) to 61.108% when pulling 8a65026 on compulim:fix-2709 into eb750b3 on microsoft:master.

@compulim compulim merged commit c61576d into microsoft:master Dec 12, 2019
@compulim compulim deleted the fix-2709 branch December 12, 2019 01:45
@corinagum corinagum mentioned this pull request Dec 13, 2019
73 tasks
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.

Reduce wasted render on every incoming/outgoing activities
4 participants