helix
helix copied to clipboard
Significant slowdowns or stalls when working with files with very long lines
Summary
I happened to want to peek inside a 5M character compacted json file, so I opened it with Helix, and immediately noticed the slowdown. It's a bit better with the syntax highlighting off, but still worse than bearable.
I think we should abort rendering a line after some characters and just leave an ellipsis instead, I believe VSCode does this.
Reproduction Steps
Here are a few simple lines of bash to generate a suffering file, be careful not to put too high a number in the second line, it can crash your computer (as I learnt the hard way)
$ printf '{' > long.json
$ printf '%.0s"foo":"bar",' {1, 100000} >> long.json
$ printf '"foo":"bar"}\n' >> long.json
$ hx long.json
Helix log
~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines
Platform
Linux
Terminal Emulator
Helix Version
22.08.1-335-g801984c7
There's already a few issues about this, rendering isn't optimized for incredibly long lines and will do a bunch of redundant work for off screen code.