Changeset 9676


Ignore:
Timestamp:
Dec 5, 2009, 7:30:15 PM (11 years ago)
Author:
charles
Message:

(trunk libT) #2551 "when uploading to peers, prefetch local data from disk" -- prefetching performance tweak described in http://trac.transmissionbt.com/ticket/2551#comment:22 -- instead of prefetching [8..12] blocks, always prefetch 12 blocks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/peer-msgs.c

    r9671 r9676  
    18031803{
    18041804    int i;
    1805     uint64_t next = 0;
    1806 
    1807     /* Maintain at least 8 prefetched blocks per unchoked peer, but allow
    1808        up to 4 extra blocks if that would cause sequential writes. */
    1809     for( i=msgs->prefetchCount; i<msgs->peerAskedForCount; ++i )
     1805
     1806    /* Maintain 12 prefetched blocks per unchoked peer */
     1807    for( i=msgs->prefetchCount; i<msgs->peerAskedForCount && i<12; ++i )
    18101808    {
    18111809        const struct peer_request * req = msgs->peerAskedFor + i;
    1812         const uint64_t begin = tr_pieceOffset( msgs->torrent, req->index, req->offset, 0 );
    1813         const uint64_t end = begin + req->length;
    1814         const tr_bool isSequential = next == begin;
    1815 
    1816         if( ( i >= 12 ) || ( !isSequential && ( i >= 8 ) ) )
    1817             break;
    1818 
    18191810        tr_ioPrefetch( msgs->torrent, req->index, req->offset, req->length );
    18201811        ++msgs->prefetchCount;
    1821 
    1822         next = end;
    18231812    }
    18241813}
Note: See TracChangeset for help on using the changeset viewer.