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

AnsiEsc bottleneck on large files #240

Open
mortang2410 opened this issue Oct 3, 2018 · 3 comments
Open

AnsiEsc bottleneck on large files #240

mortang2410 opened this issue Oct 3, 2018 · 3 comments
Assignees
Labels

Comments

@mortang2410
Copy link

mortang2410 commented Oct 3, 2018

Try running journalctl with let g:vimpager.ansiesc = 0 and without it (assuming you're using systemd). Or view any really big text file.
vim with AnsiEsc would choke and wait until AnsiEsc finishes. While vim alone is fast enough to read through, like, 1521561 lines of text in a few seconds.

This might seem like a stretch goal, and this scenario isn't always common, but maybe AnsiEsc should be turned off after a set number of lines to prevent this scenario.

@rkitover
Copy link
Owner

rkitover commented Oct 4, 2018

What you suggest is a simple enough fix, I'll try to do it shortly.

@rkitover rkitover self-assigned this Oct 4, 2018
@rkitover rkitover added the bug label Oct 4, 2018
rkitover added a commit that referenced this issue Oct 4, 2018
Files with ansi codes that are very big take too long to process with
ansiesc, making vim hang.

When enabling ansiesc for a file passed to vimpager, check if the number
of lines is greater than 1250, if it is, strip ansi codes instead.
@rkitover rkitover added the fixed label Oct 4, 2018
@rkitover
Copy link
Owner

rkitover commented Oct 4, 2018

Fixed in master, see above commit.

@rkitover
Copy link
Owner

rkitover commented Oct 4, 2018

I chose 1250 lines for the cutoff because it's roughly 3 seconds on modern hardware.

@rkitover rkitover removed the fixed label Mar 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants