Changeset 7339


Ignore:
Timestamp:
Dec 10, 2008, 3:50:39 AM (12 years ago)
Author:
charles
Message:

(1.4x libT) #1580: increase the read buffer for the "verify local data" reader to make it a little faster

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.4x/libtransmission/inout.c

    r7142 r7339  
    3131#include "utils.h"
    3232
     33#ifdef TR_EMBEDDED
     34 #define TR_HASH_BUFSIZE (16*1024)
     35#else
     36 #define TR_HASH_BUFSIZE (64*1024)
     37#endif
     38
    3339/****
    3440*****  Low-level IO functions
     
    217223                 uint8_t *          setme )
    218224{
    219     size_t   bytesLeft;
     225    static uint8_t * buf = NULL;
     226    size_t bytesLeft;
    220227    uint32_t offset = 0;
    221     int      success = TRUE;
     228    int success = TRUE;
    222229    SHA_CTX  sha;
     230
     231    if( buf == NULL )
     232        buf = tr_new( uint8_t, TR_HASH_BUFSIZE );
    223233
    224234    assert( tor );
     
    231241    while( bytesLeft )
    232242    {
    233         uint8_t   buf[8192];
    234         const int len = MIN( bytesLeft, sizeof( buf ) );
     243        const int len = MIN( bytesLeft, TR_HASH_BUFSIZE );
    235244        success = !tr_ioRead( tor, pieceIndex, offset, len, buf );
    236245        if( !success )
Note: See TracChangeset for help on using the changeset viewer.