Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Improve switch room rendering#6079

Merged
germain-gg merged 28 commits into
developfrom
gsouquet/switch-rooms
Jun 3, 2021
Merged

Improve switch room rendering#6079
germain-gg merged 28 commits into
developfrom
gsouquet/switch-rooms

Conversation

@germain-gg
Copy link
Copy Markdown
Contributor

Improves element-hq/element-web#4997

This reduces the time it takes to switch rooms without undergoing massive changes in TimelinePanel or ScrollPanel. There are a lot of room for improvement there but the changes required are a lot more invasive

Two main optimisations are applied here

  • Reducing the amount of elements in the DOM where possible
  • Batching setState calls together and leveraging cached values to avoid a two step render where possible

When using a development build of react I managed to reduce the initial render from 570ms to 320ms which accounts for a 56% decrease in rendering time

@germain-gg germain-gg requested a review from a team May 21, 2021 11:40
Copy link
Copy Markdown
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

overall looks fine - just a few relatively minor concerns. Thanks for poking this!

Comment thread src/components/structures/ContextMenu.tsx Outdated
Comment thread src/components/structures/RoomView.tsx Outdated
Comment thread src/components/structures/RoomView.tsx Outdated
Comment thread src/components/structures/RoomView.tsx
Comment thread src/components/structures/RoomView.tsx Outdated
Comment thread src/components/views/rooms/EventTile.tsx Outdated
@germain-gg germain-gg requested a review from turt2live May 24, 2021 08:18
Copy link
Copy Markdown
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

github wants words in this box

@turt2live
Copy link
Copy Markdown
Member

also merge conflicts (already) :(

@germain-gg germain-gg merged commit 7f83590 into develop Jun 3, 2021
@germain-gg germain-gg deleted the gsouquet/switch-rooms branch June 3, 2021 07:44
jryans added a commit that referenced this pull request Jun 4, 2021
#6079 caused a regression in
the event status indicator. The `mx_EventTile_msgOption` container was folded
into the avatars code path, but the event status is a special case of this, so
it now needs to also have this container to preserve its positioning.

Fixes element-hq/element-web#17552
@robintown robintown mentioned this pull request Jun 6, 2021
jryans added a commit that referenced this pull request Jun 16, 2021
A recent change (47e007e) introduced a
regression where we failed to check whether a reply thread has a next reply.
This meant that we would end up sending `/context/undefined` requests to the
server for every reply thread on every room view.

Fixes element-hq/element-web#17563
Regressed by #6079
jryans added a commit that referenced this pull request Jun 17, 2021
A recent change (47e007e) introduced a
regression where we failed to check whether a reply thread has a next reply.
This meant that we would end up sending `/context/undefined` requests to the
server for every reply thread on every room view.

Fixes element-hq/element-web#17563
Regressed by #6079
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants