rtorrent-ps icon indicating copy to clipboard operation
rtorrent-ps copied to clipboard

Session save optimization

Open pyroscope opened this issue 6 years ago • 2 comments

DownloadStore::save(Download* d, int flags) could be optimized to not write unchanged resume data (by adding a new flag). Implement by storing the SHAs of the bencode data last written, adding very little memory overhead.

Reasons are less SSD wear and tear (a big session can have 100MiB, written every 20min by defaut), and UI freezes can happen if the file system blocks or is slow. Many loaded mostly idle items make this more prominent.

Note that uncertain_pieces.timestamp in *.libtorrent_resume changes every time.

pyroscope avatar Apr 19 '18 19:04 pyroscope

Another route could be to write a command that saves the session in chunks of size arg.0 (using the uncertain_pieces.timestamp to roll through loaded items), and change the save_session schedule to run way more often and use that new command.

pyroscope avatar Apr 19 '18 20:04 pyroscope

Since I went through all your configs and I haven't seen this in them (as far as I can recall): this can be a workaround until you fix it. Thanks!

chros73 avatar Apr 20 '18 08:04 chros73