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

Avoid reading whole file #18

Open
GreyCat opened this issue Aug 13, 2017 · 1 comment
Open

Avoid reading whole file #18

GreyCat opened this issue Aug 13, 2017 · 1 comment

Comments

@GreyCat
Copy link
Member

GreyCat commented Aug 13, 2017

Code generated by KS does a fairly good job at not reading the whole file in memory and even doing stuff lazily where possible, but HexViewer component of ksv currently works with a byte array buffer, which is always filled up like that:

  def hv_update_io
    io = @cur_node.io
    if io != @cur_io
      @cur_io = io
      io.seek(0)
      buf = io.read_bytes_full
      @hv.buf = buf
    end
  end

So, effectively it means that huge files would be read fully into memory before doing any visualizations at all. Partially, it depends on kaitai-io/kaitai_struct#44, but even without that probably we could do a IO-based instead of preread byte array based HexViewer.

@honeyspoon
Copy link

any update on this?
don't know enough about ruby of the project to implement this but it seems like a great feature

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

No branches or pull requests

2 participants