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

Rendering line numbers for code blocks gets very slow past a few hundred lines #19202

Closed
squahtx opened this issue Sep 28, 2021 · 3 comments
Closed
Labels
A-Performance O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Platform-Specific

Comments

@squahtx
Copy link

squahtx commented Sep 28, 2021

Steps to reproduce

  1. Look at https://matrix.to/#/!ehXvUhWNASUkSLvAGP:matrix.org/$_GbJeMbzwT7yp7w2-euN-HUHcrnSeGlQzITxcbkW3Wg?via=matrix.org&via=libera.chat&via=underzsea.com in #synapse:matrix.org, or send a 500-700 line code block. The code block doesn't have to have anything apart from line breaks in it.
  2. Element Web freezes for multiple seconds

image
addLineNumbers appears to take quadratic time; the spacing of the blue bits gets larger and larger as time progresses.

What happened?

What did you expect?

Element Web to be responsive

What happened?

Element Web froze for ~10 seconds

Operating system

Windows

Browser information

Chrome 93.0.4577.82

URL for webapp

develop.element.io

Homeserver

matrix.org

Have you submitted a rageshake?

No

@SimonBrandner SimonBrandner added A-Performance O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist labels Sep 28, 2021
@kittykat
Copy link
Contributor

I had no issues with that message on Web (develop.e.i, Chromium), so marking as platform specific.

@ndren
Copy link

ndren commented Oct 19, 2023

@squahtx if it still comes up, the repository for addLineNumbers seems to be matrix-react-sdk: https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/components/views/messages/TextualBody.tsx

@Johennes
Copy link
Contributor

I tried desktop and web in Firefox but couldn't reproduce this, neither with the message linked above or a custom code block of a few hundred lines. Closing as we don't appear to have had a reproducible error case here since 2021.

@Johennes Johennes closed this as not planned Won't fix, can't repro, duplicate, stale Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Performance O-Uncommon Most users are unlikely to come across this or unexpected workflow S-Minor Impairs non-critical functionality or suitable workarounds exist T-Defect Z-Platform-Specific
Projects
None yet
Development

No branches or pull requests

5 participants