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

Improve Big File Behavior #90

Open
haydenflinner opened this issue Oct 8, 2021 · 0 comments
Open

Improve Big File Behavior #90

haydenflinner opened this issue Oct 8, 2021 · 0 comments

Comments

@haydenflinner
Copy link

Before the following feedback, I'd like to say that I am so glad that I found this repo. I have been looking for over a year for a project like this, as I knew I couldn't be the only one unsatisfied by less but not wanting to buy a closed source log viewer. This even has a feature that I knew I wanted but would have settled without, the highlighting / filtering. It's fleshed out in a way more intuitive way than I probably would have come up with. I've started implementing from scratch a similar project probably twice in the last two years, and tried modifying other pagers once or twice as well. This project is the closest one I've seen to what I'd like!

Now, on to my initial tests with the pager, which unfortunately show that I can't use this tool just yet.

ls -lah gigabyte.txt
-rw-r--r-- 1 hayden users 3.0G Oct  7 20:36 gigabyte.txt

./slit_linux_amd64 gigabyte.txt

Already, slit has started doing something which less does not. I see it reading through the entire file to determine line numbers; This pegs the CPU to 100%, which is something that I prefer it not do. I would prefer if it only read essentially what I asked it to, whether by scrolling or by searching.

Luckily, it doesn't seem to try to keep the whole file in memory, which is good. Now, my fan has gone off, it has read in the whole file (which would not be possible with some production logs I have seen, unfortunately).
I try this: /my search string which doesn't appear

Which freezes the program and again we're back to 100% CPU. This is fine, less is also unresponsive when searching. The only problem is that "CTRL+C" does not interrupt the search and bring the program back to life. Nor does CTRL+D, and CTRL+Z is apparently hooked because I can't background this process, either. The only option is to go to another terminal and SIGTERM it.

If you have any pointers as to where I would start implementing the large-file behavior that I'm looking for (in terms of loading only what is needed), I would greatly appreciate it. The CTRL+C behavior I think you might look at as a bug, and may want to fix yourself as I am not experienced with Go, but if not, I will also try fixing that while I'm tinkering.

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

No branches or pull requests

1 participant