anacrolix / anacrolix/torrent

Implement cache layer for file storage

Đang mở
#265 8 bình luận 2 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Go
Star
6.1k
Fork
690
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
12

Mô tả

This was mentioned in #234.
Disk operations are not so great on Windows/Android systems.
So we can add a disk cache from our side to collect write operations and flush them once buffer if filled up or periodically.

This one is implemented in libtorrent. Some interesting points there: https://github.com/arvidn/libtorrent/blob/master/src/disk_io_thread.cpp#L874 and https://github.com/arvidn/libtorrent/blob/master/src/disk_io_thread.cpp#L1679 .
Not sure we need that level of complexity.
I was looking at golang's bufio implementation (https://golang.org/src/bufio/bufio.go?s=14456:14486#L599) which is pretty simple. We just miss offset writes, and, probably, need to collect multiple consequent chunks into one bigger write operation.

Probably have to manage flushing if need to verify the piece or something.

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

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

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.