element-web icon indicating copy to clipboard operation
element-web copied to clipboard

Composer lag

Open lampholder opened this issue 2 years ago • 16 comments

Steps to reproduce

  1. Where are you starting? What can you see? Over the past week or so I've noticed worse and worse lag when typing in the normal, non-WYSIWYG composer.

I've been signed in forever, have slept/woken the computer a few times since the last reboot. There's no typing lag elsewhere on the machine.

Element is using between 5% and 30% CPU and ~1GB RAM. Machine specs:

  • Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz 4.00 GHz
  • 32.0 GB
  • Windows 10 Pro 22H2 19045.3086

Outcome

What did you expect?

No lag

What happened instead?

Lag

Operating system

Windows 10

Application version

Element version: 1.11.34 Olm version: 3.2.14

How did you install the app?

Website

Homeserver

lant.uk

Will you send logs?

Yes

lampholder avatar Jul 04 '23 12:07 lampholder

Chat effects such as confetti are also very slow.

lampholder avatar Jul 04 '23 12:07 lampholder

Could be https://github.com/vector-im/element-web/issues/24091 or https://github.com/vector-im/element-web/issues/23268

@lampholder thank you for opening the issue. If possible, can you send logs when the composer is lagging? A profile would also help

weeman1337 avatar Jul 05 '23 08:07 weeman1337

I can't generate a profile out of Element Desktop on Windows - the profile generates but saving it saves an empty file.

lampholder avatar Jul 17 '23 10:07 lampholder

I'm getting (less pronounced, but still noticeable) composer lag on Mac, too. I'll send logs for that (attached to this issue) and see if I can dump a profile out of Electron Mac

lampholder avatar Jul 17 '23 11:07 lampholder

Nope, mac profiles also save as zero byte files.

lampholder avatar Jul 17 '23 11:07 lampholder

Is this normal (from activity monitor on the mac)?: image

Here's Element X for comparison: image

My Electron instance does have encrypted search enabled: Screenshot 2023-07-17 at 12 13 23

lampholder avatar Jul 17 '23 11:07 lampholder

I've filed another rageshake for this - on firefox at least I'm now seeing regular 10 second pauses interacting with the client at all (so not just typing into the composer, but scrolling/dismissing modals/even copying a link is blocked whilst the browser does whatever it's doing.

lampholder avatar Nov 10 '23 10:11 lampholder

Firefox 2023-11-24 11.27 profile.json.gz

^ profiling info from Firefox while the composer was lagging (in Element R, local build, though, which muddies the water)

andybalaam avatar Nov 24 '23 11:11 andybalaam

@andybalaam is it a development or production build? Development React builds are known to be laggy and it isn't something we can do much if anything about

t3chguy avatar Nov 24 '23 11:11 t3chguy

@andybalaam is it a development or production build? Development React builds are known to be laggy and it isn't something we can do much if anything about

This was a dev build, so I guess ignore for now until I can get something more useful.

andybalaam avatar Nov 24 '23 11:11 andybalaam

presumably it is no longer correct for this to be labelled as X-Needs-Info

richvdh avatar Mar 04 '24 16:03 richvdh

I've got composer lag again having updated to Element version: 1.11.62 Crypto version: Olm 3.2.15 this morning :(

lampholder avatar Mar 27 '24 09:03 lampholder

Suggestion from web team is that (on this occasion at least):

its likely due to https://github.com/element-hq/synapse/issues/16987 which causes https://github.com/element-hq/element-web/issues/27173

Aside from this, I haven't experience composer lag in recent versions prior to 1.11.62, so perhaps this issue can be closed.

lampholder avatar Mar 27 '24 09:03 lampholder

so perhaps this issue can be closed

Please don't, I have this exact issue on 1.11.79, Crypto version: Rust SDK 0.7.2 (7a21514), Vodozemac 0.7.0

dasJ avatar Oct 07 '24 11:10 dasJ

This has been happening to me, starting a few weeks ago, on Firefox 139 now, EW 1.11.103, downloaded from Github. This is the only place on my machine where I face considerable input lag. (It's an Intel Raptor Lake laptop, so relatively recent hardware.)

I can easily gather profile traces (using Firefox's built-in profiler) that show the problem, but I am not comfortable sharing them---they seem to contain screenshots, information on all my open tabs, all sorts of sensitive stuff...

So here I go copy-pasting screenshots instead. If you need more/different info, I would be happy to provide it. The main culprit seems to be a rapid growth of memory allocation while typing in the composer, see the memory bar in this screenshot:

Image

That period of rapid growth (about 700M!) is when I was typing. The actual jank is then caused by GC pauses trying to cope with that memory growth. This screenshot has more information, including Firefox's helpful "Jank" metric building towards what looks like a run of the cycle collector ("CC"), if I'm understanding all of this correctly:

Image

inducer avatar Jun 10 '25 16:06 inducer

In my case, this may have something to do with the specific Firefox build I had been using. I was using the .deb package from Mozilla itself (on Debian Linux). Switching to Debian-packaged Firefox avoids the second-long lag I was experiencing.

inducer avatar Jun 13 '25 19:06 inducer

Never mind, the Debian build has "caught up". As of Firefox 140, the Element Web composer is very laggy on Firefox, as described above.

inducer avatar Jul 03 '25 13:07 inducer