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

Commit

Permalink
Fix CPU spin on joining large room
Browse files Browse the repository at this point in the history
checkIfAlone() filters the whole member list, which is fine until
we do it once for every membership event, then we have an n^2
problem. Move it into the rate limited function.

Fixes element-hq/element-web#7163
  • Loading branch information
dbkr committed Aug 22, 2018
1 parent c00610c commit 852d6a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/structures/RoomView.js
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,6 @@ module.exports = React.createClass({
}

this._updateRoomMembers();
this._checkIfAlone(this.state.room);
},

onRoomMemberMembership: function(ev, member, oldMembership) {
Expand All @@ -717,6 +716,7 @@ module.exports = React.createClass({
// refresh the conf call notification state
this._updateConfCallNotification();
this._updateDMState();
this._checkIfAlone(this.state.room);
}, 500),

_checkIfAlone: function(room) {
Expand Down

0 comments on commit 852d6a3

Please sign in to comment.