ttorrent icon indicating copy to clipboard operation
ttorrent copied to clipboard

Optimize Piece-s memory usage

Open gzsombor opened this issue 11 years ago • 0 comments

Remove a couple of unnecessary fields from the Piece class :

  • offset -> can be calculated from index * pieceLength
  • seeder -> torrent.isSeeder()
  • bucket -> torrent.getBucket()
  • hash -> which is equivalent with torrent.getPiecesHashes() from index*Torrent.PIECE_HASH_SIZE, so we don't have duplicate this information.

gzsombor avatar Feb 25 '13 00:02 gzsombor