Skip to content

Severe Performance Issues with XML Code Blocks #164

@iniNight

Description

@iniNight

When I add three code blocks with XML syntax highlighting to a note — containing 20 lines, 49 lines, and 7 lines respectively — I encounter severe performance issues.

If I do not specify a language type after the triple backticks (), I can type very quickly and experience almost no lag. However, once I add the XML language identifier (xml) to all three code blocks, typing becomes extremely laggy. Even slow typing has noticeable input delay.

In extreme cases, if I hold down the a key, I can actually hear my computer fans ramp up aggressively while the key is held down. After releasing the key, the fans gradually return to normal speed. During this time, the entire application practically freezes.

I also noticed that the issue becomes significantly worse as the code block grows in line count and total character count. For example:

  • If only the 7-line code block has XML syntax highlighting enabled, holding down the a key causes almost no noticeable lag.
  • With the 20-line XML code block, holding down the key already introduces obvious lag, although the system does not completely freeze. The fans still spin up heavily.
  • With the 49-line XML code block, the issue becomes extremely severe.

Besides typing latency, simply scrolling through the note also becomes laggy after enabling all three XML syntax highlighting.

I have not yet tested other languages extensively, so I cannot confirm whether this issue is specific to XML.

At this point, I cannot imagine how severe the lag would become with even larger XML code blocks. It makes me suspect there may be a problem with the rendering or syntax-highlighting logic.
btw, my cpu is amd 7800x3d, i think this issue probably does not have much to do with my computer hardware.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions