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

Poor performance on string highlighting #2839

Open
SollyBunny opened this issue Jun 11, 2023 · 5 comments · May be fixed by #3127
Open

Poor performance on string highlighting #2839

SollyBunny opened this issue Jun 11, 2023 · 5 comments · May be fixed by #3127
Labels
Milestone

Comments

@SollyBunny
Copy link

Description of the problem or steps to reproduce

In a large text document placing a single quote will freeze micro to the point where I end up just killing it. ):

Specifications

Version: 0.0.0-unknown
Commit hash: 0859f4a
Compiled on June 09, 2023
OS: Arch Linux x64
Terminal: Kitty

@JoeKar
Copy link
Collaborator

JoeKar commented Jun 11, 2023

Can you please provide a sample document? I will have a look into it, if things can be improved.

@SollyBunny
Copy link
Author

SollyBunny commented Jun 11, 2023

While trying to get something to work with strings I got it to work with the script tag and it crashes as it attempts to highlight the js
This death by recursion is probably because of the highlighter now using a recursive regex.
The error is attatched since it's quiet long
error.log

Steps to reproduce:

  1. download sample.md file (doesn't let me attach html files)
  2. rename it to *.html
  3. open it in micro
  4. insert <script> on the first line
  5. death

The original file I experiences the hang on can't be shared since it contains personal information

@JoeKar
Copy link
Collaborator

JoeKar commented Jun 13, 2023

@SollyBunny:
Please give some feedback how the general behavior is with #2840 regarding the performance.

@SollyBunny
Copy link
Author

Is the same

@JoeKar
Copy link
Collaborator

JoeKar commented Jan 20, 2024

I took this issue and currently try to improve the highlighting performance. The first result is a ~50% faster highlighting, but it's still horrible slow in case a lot of (nested) regions are placed in a very long line.
Further improvements need some larger rework in the highlighting code, which isn't really optimized so far. But this will take some more time, since changes there easily brake the whole feature. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants