gitui-org / gitui-org/gitui

Load partial files lazily for preview

Đang mở
#2,256 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
feature-request
Ngôn ngữ chính
Rust
Star
22.5k
Fork
773
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Is your feature request related to a problem? Please describe.**
If you have large files in your repo, gitui tries to load more than what is required, and it seems to block the ui partially, and causes application to freeze for a few seconds depending on the performance of the machine, it almost froze on my rpi, but it was just a 1-2 second stutter on my workstation.

**Describe the solution you'd like**
I am unsure about the implementation. But it should provide lazy "partial" file loading for previews so that it only loads the first N bytes required for displaying the preview. It should be fairly easy to implement it irrespective of platform and will help avoid the cost of fetching large files.

Also, I am not entirely sure if this is a feature request but as it didn't feel fair calling it a bug so here it is.

**Describe alternatives you've considered**
None, I can't think of any other solutions, in case it's already implemented it might be worth looking into why it stutters with large files, we can also directly back the preview with Mmap to ensure not more than the part of the file required for preview is loaded (I haven't written interactive tui in rust much, so I am unsure, but I think it shouldn't be hard to implement).

**Additional context**
Will try to find time to implement it, also have a look at gitui code base while I am at it.

I don't use gitui much, but it's a nice to have, to stage changes partially, thanks for the hard work folks.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Issue không nêu tệp hoặc bài kiểm thử nào. Hãy bắt đầu bằng cách lần theo cách gitui tải tệp để xem trước và tái hiện hiện tượng giật với một tệp lớn. Công việc được xem là hoàn tất khi phần xem trước chỉ tải phần đầu cần thiết và UI vẫn phản hồi tốt.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
git, rust
Lĩnh vực
cli, performance
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
25/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.