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

Frequent long hangs in large rooms on Gitter #24668

Closed
jgonggrijp opened this issue Feb 25, 2023 · 1 comment
Closed

Frequent long hangs in large rooms on Gitter #24668

jgonggrijp opened this issue Feb 25, 2023 · 1 comment
Labels
A-Timeline O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@jgonggrijp
Copy link

Steps to reproduce

  1. Visit app.gitter.im.
  2. Sign in.
  3. Join gitter/developers or another large chatroom.
  4. Wait for the animation to complete that makes a collage of tiny thumbnails of the profile pictures of all the users in the room (this is pointless and annoying, but not the topic of this issue ticket).
  5. Interact with the Element interface while inside the room, such as typing a message, opening or closing threads, hovering over buttons, etcetera.
  6. Soon enough, you will notice that Element goes intermittently unresponsive. If you type a message, the characters you type take very long to appear inside the message input field. If you hover a button, neither the button nor the cursor change appearance, unless you wait it out. Likewise for the effect that should follow when you click a button.

Outcome

What did you expect?

Whenever I interact with the interface, I expect at least an indication that my action will eventually have an effect within 200 milliseconds or so. Ideally, not only an indication but the effect itself should come instantaneously (i.e., within 50 ms).

What happened instead?

During unresponsive periods, it can take up to 30 seconds before I get any confirmation at all that something might happen. When typing inside the message box, it can take so long before the first character appears, with additional delays before subsequent characters appear. Likewise for hovering and clicking buttons. Unresponsive periods tend to follow back to back, with the intervals between the unresponsive periods becoming shorter over time. After several minutes, Element is pretty much unusable. Safari also displays a message that the site is drawing a lot of energy and will sometimes reload the page for this reason.

The wholesale unresponsiveness made me suspect that something was clogging the CPU, so I let Safari's profiler run for a while. I found periods of 10+ seconds where CPU usage was around the 100% mark. Inspecting one such period, I found that more than half of the time was spent inside a function named getId, which is defined inside js-sdk/src/models/event.ts. It is indirectly called by methods inside MessagePanel.tsx and TimelinePanel.tsx. Unfortunately, the sourcemap is broken, so I could not analyze the call stack in more detail.

Screenshot of the profiler in "reverse" mode (innermost function call on top):
Schermafbeelding 2023-02-25 om 18 37 13

Screenshot of the profiler in "normal" mode (outermost function call on top), showing only one out of three call stacks that are getId-heavy:
Schermafbeelding 2023-02-25 om 18 44 50

Operating system

macOS

Browser information

Safari 15.6.1 (15613.3.9.1.16, 15613)

URL for webapp

app.gitter.im

Application version

Gitter version: 1.11.23, Olm version: 3.2.12

Homeserver

gitter.im

Will you send logs?

Yes

@florianduros florianduros added S-Major Severely degrades major functionality or product features, with no satisfactory workaround A-Timeline O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience labels Feb 27, 2023
@t3chguy
Copy link
Member

t3chguy commented Feb 27, 2023

getId is a red herring here, the actual issue is shouldShowEvent - duplicate of #24480

@t3chguy t3chguy closed this as completed Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Timeline O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

No branches or pull requests

3 participants