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

Load only enough bytes to fill the console #69

Closed
ChristopherRabotin opened this issue Mar 29, 2022 · 2 comments
Closed

Load only enough bytes to fill the console #69

ChristopherRabotin opened this issue Mar 29, 2022 · 2 comments
Labels

Comments

@ChristopherRabotin
Copy link

Is your feature request related to a problem? Please describe.
I'm always frustrated when I try to use hx for a very large file. For example, when trying to load a 3.1 GB binary file, it eventually used up 16 GB of RAM before I stopped the process.

Describe the solution you'd like
I think that a potential solution would involve replacing the fs::File::open with an unsafe memmap call. Just that would probably save a lot of memory usage.

Describe alternatives you've considered
Note that I'm not very familiar with the code at all (just started reading it today). That said, another alternative would be to not append the given line to the page.body for all of the bytes ... and maybe the truncate_len used in buf_to_array should be set to the console's number of lines somehow? The difficulty with that second approach is that at each console refresh, another part of the file will need to be parsed.

Copy link

This issue has been marked stale due to no recent activity.

@github-actions github-actions bot added the stale label Dec 12, 2023
Copy link

This issue was closed due to no activity for an extended period.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 17, 2023
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

1 participant