-
Notifications
You must be signed in to change notification settings - Fork 20
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
TW-1650: part II: memory footprint in web: remove unnecessary animation and Image.memory in web #1741
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sherlockvn
requested review from
hoangdat,
dab246,
nqhhdev,
hieutbui,
tddang-linagora and
Te-Z
as code owners
May 6, 2024 08:24
This PR has been deployed to https://linagora.github.io/twake-on-matrix/1741 |
sherlockvn
changed the title
TW-1650: remove unnecessary animation and Image.memory in web
TW-1650: part II: memory footprint in web: remove unnecessary animation and Image.memory in web
May 6, 2024
nqhhdev
reviewed
May 6, 2024
nqhhdev
reviewed
May 6, 2024
Te-Z
reviewed
May 6, 2024
sherlockvn
force-pushed
the
TW-1650-part-II-memory-footprint-web
branch
from
May 8, 2024 05:54
eef4d7b
to
86560f7
Compare
sherlockvn
force-pushed
the
TW-1650-part-II-memory-footprint-web
branch
from
May 13, 2024 03:29
17e41ef
to
86ea1aa
Compare
sherlockvn
force-pushed
the
TW-1650-part-II-memory-footprint-web
branch
from
May 13, 2024 03:44
86ea1aa
to
bcdfde1
Compare
nqhhdev
reviewed
May 13, 2024
hoangdat
approved these changes
May 13, 2024
sherlockvn
force-pushed
the
TW-1650-part-II-memory-footprint-web
branch
from
May 13, 2024 04:26
bcdfde1
to
f509ced
Compare
sherlockvn
force-pushed
the
TW-1650-part-II-memory-footprint-web
branch
from
May 13, 2024 10:13
f509ced
to
7103f98
Compare
Screen.Recording.2024-05-13.at.17.14.04.mov |
hoangdat
reviewed
May 13, 2024
hoangdat
approved these changes
May 14, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
DESC:
#1650
Problem:
Currently, we use
Image.memory
to load image data to view, which required two steps, its need to downloaded to memory first, then pass it to the widget, which make app freezes a lot while scrolling.Moreover,
MxcImage
use combination of animation and setState when image is downloaded, which is not efficient.-
Image.network
have multiple optimization, and build-in method (loadingBuilder
andframeBuilder
) which make the rendering in web more efficient. And We don't have to convert to bytes anymore, use the download link, and the browser will help us caching the image.For the case of encrypted chat, we still have to use
Image.memory
because of we have to decrypte bytes data after downloading doneFor the case of
Avatar
, use cacheWidth to reduce the memory usage when decoding imageReference:
Reference of frameBuilder in Image.network
Compare performance and memory usage between beta.twake.app and current
Screen.Recording.2024-05-06.at.15.18.51.mov
Demo:
Screen.Recording.2024-05-08.at.12.51.37.mov
Screen.Recording.2024-05-08.at.12.46.10.mov
RPReplay_Final1715168002.MP4