Changeset 6259


Ignore:
Timestamp:
Jun 27, 2008, 2:42:44 AM (13 years ago)
Author:
charles
Message:

part 1 of Aloisius' performance patch

Location:
trunk/libtransmission
Files:
4 edited

Legend:

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

    r5917 r6259  
    317317    io->timeout = secs;
    318318    bufferevent_settimeout( io->bufev, io->timeout, io->timeout );
     319    bufferevent_enable( io->bufev, EV_READ|EV_WRITE );
    319320}
    320321
  • trunk/libtransmission/peer-mgr.c

    r6236 r6259  
    6161
    6262    /* max # of peers to ask fer per torrent per reconnect pulse */
    63     MAX_RECONNECTIONS_PER_PULSE = 1,
     63    MAX_RECONNECTIONS_PER_PULSE = 4,
    6464
    6565    /* max number of peers to ask for per second overall.
     
    15381538    const struct ChokeData * a = va;
    15391539    const struct ChokeData * b = vb;
    1540     return -tr_compareUint32( a->rate, b->rate );
     1540    int diff = 0;
     1541
     1542    if( diff == 0 ) /* prefer higher dl speeds */
     1543        diff = -tr_compareDouble( a->peer->rateToClient, b->peer->rateToClient );
     1544    if( diff == 0 ) /* prefer higher ul speeds */
     1545        diff = -tr_compareDouble( a->peer->rateToPeer, b->peer->rateToPeer );
     1546    if( diff == 0 ) /* prefer unchoked */
     1547        diff = (int)a->peer->peerIsChoked - (int)b->peer->peerIsChoked;
     1548
     1549    return diff;
    15411550}
    15421551
  • trunk/libtransmission/peer-msgs.c

    r6101 r6259  
    13261326            dbgmsg( msgs, "got Interested" );
    13271327            msgs->info->peerIsInterested = 1;
    1328             tr_peerMsgsSetChoke( msgs, 0 );
    13291328            break;
    13301329
     
    17351734{
    17361735    if( what & EVBUFFER_TIMEOUT )
    1737         dbgmsg( vmsgs, "libevent got a timeout, what=%hd", what );
     1736        dbgmsg( vmsgs, "libevent got a timeout, what=%hd, secs=%d", what, evbuf->timeout_read );
    17381737    if( what & ( EVBUFFER_EOF | EVBUFFER_ERROR ) )
    17391738        dbgmsg( vmsgs, "libevent got an error! what=%hd, errno=%d (%s)",
  • trunk/libtransmission/ratecontrol.c

    r5949 r6259  
    3131
    3232#define GRANULARITY_MSEC 500
    33 #define SHORT_INTERVAL_MSEC 4000
     33#define SHORT_INTERVAL_MSEC 1000
    3434#define LONG_INTERVAL_MSEC 8000
    3535#define HISTORY_SIZE (LONG_INTERVAL_MSEC / GRANULARITY_MSEC)
     
    5757    for( ;; )
    5858    {
    59         if( r->transfers[i].date < cutoff )
     59        if( r->transfers[i].date <= cutoff )
    6060            break;
    6161
Note: See TracChangeset for help on using the changeset viewer.