-
Notifications
You must be signed in to change notification settings - Fork 5
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
PLAT-109381: Reduce the ImageItem render time #461
Conversation
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
This reverts commit 8f471c6.
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
This reverts commit 2678a8f.
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
This reverts commit e83f4d6.
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
This reverts commit 65fa755.
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])
This reverts commit 5d3d3ab.
|
Due to Contributor License Agreement, I'd like to close this PR. |
Checklist
Issue Resolved / Feature Added
One of the major cause for the list scroll performance is the long JS execution time of the ImageItem. So we need to reduce the ImageItem render time.
Resolution
children
for caption,label
for subcaption,imageIconComponent
,imageIconSrc
, andsrc
not as props but thought a context so that we don't have to render several components again.Update the caption, subcaption, and data-index DOM elements directly instead of rendering components.By doing it, the number of the React elements rendering could be reduced.
For example, with the
develop
branch without the PR14 React elements are re-rendered to update the
src
from thesandstone/ImageItem
(ImageItem
in the diagram below) to theui/Image
(ui:Image
in the diagram below).With the PR
only some of those React elements are re-rendered to do it because the
src
will be passed through a context from theContext.Provider
in thesandstone/Image
toContext.Consumber
beforeui/Image
.As we do with the
src
,children
for the caption,label
for the subcaption,imageIconComponent
, andimageIconSrc
are also passed through a context. Those props are one being updated frequently while scrolling a VirtualList (or VirtualGridList) and swapping items.Therefore we could enhance the list scroll performance by reducing the ImageItem rendering time. It's the major cause for the low performance.
Additional Considerations
Links
PLAT-109381
Related PR: enactjs/enact#2790
Previous branch: https://github.com/enyojs/sandstone/tree/PLAT-109381-useMemo2
Comments
Enact-DCO-1.0-Signed-off-by: YB Sung ([email protected])