question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bad side-by-side scrolling performance with syntax highlighting enabled

See original GitHub issue

The scrolling performance in a side-by-side window becomes really bad sometimes when highlighting is enabled. It’s not uncommon for the CPU to hit over 100%, which causes the scrolling to freeze. It doesn’t really seem related to the file size, it also happens for files of about 200 to 300 lines.

screen shot 2018-03-14 at 14 06 31

If I understand the Google Chrome profiler correctly, then most of the time is spend on the line Prism.highlightElement(preElement);. This seems to be triggered by the scrolling event.

screen shot 2018-03-14 at 14 26 08

I haven’t looked into it any further, as I don’t really understand why the highlighter should run each time someone scrolls. But it would be great if this could be improved somehow.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Daanvmcommented, Aug 6, 2018

Update after 1 week: I’ve not noticed any glitches or performance issues anymore. Thank you so much for this great update! 🎉

1reaction
nickpeirsoncommented, Jul 22, 2018

Hey @reyronald, thanks for the update.

I’ve done few quick tests and it’s looking better so far. With it enabled, looking at pretty much any side by side diff with syntax highlighting enabled would lock up Chrome, however I’ve tried a few diffs with the latest extension version and it’s remained mostly responsive. May be a couple of small stalls still, but nothing like the previous lockups I was seeing.

I’ll keep an eye on it throughout the week and see if I hit any diffs that still cause problems, but so far so good! Thanks very much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add syntax highlighting to diffs | Bitbucket Cloud
In side-by-side only the chunk that contains the visible portion is loaded. You can see this on large files when you quickly scroll...
Read more >
Javascript syntax highlighting it not working
After I enabled the extension, syntax highlighting started working again. Go to Tools > Extensions and Updates > Installed. And look for "Visual...
Read more >
Syntax - Neovim docs
Syntax highlighting enables Vim to show parts of the text in another font or color. Those parts can be specific keywords or text...
Read more >
Slow Scrolling Syntax Highlighting : r/vim - Reddit
Every time I scroll through a file in gvim there is noticeable lag. When I disable syntax highlighting it seems to work fine....
Read more >
kitty-diff - Kovid Goyal
A fast side-by-side diff tool with syntax highlighting and images Major Features: ... J , Down. Scroll page up. PgUp. Scroll page down....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found