Changeset 7338


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

(trunk 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
  • trunk/libtransmission/inout.c

    r7249 r7338  
    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
     
    216222                 uint8_t *          setme )
    217223{
    218     size_t   bytesLeft;
     224    static uint8_t * buf = NULL;
     225    size_t bytesLeft;
    219226    uint32_t offset = 0;
    220     int      success = TRUE;
     227    int success = TRUE;
    221228    SHA_CTX  sha;
     229
     230    if( buf == NULL )
     231        buf = tr_new( uint8_t, TR_HASH_BUFSIZE );
    222232
    223233    assert( tor );
     
    230240    while( bytesLeft )
    231241    {
    232         uint8_t   buf[8192];
    233         const int len = MIN( bytesLeft, sizeof( buf ) );
     242        const int len = MIN( bytesLeft, TR_HASH_BUFSIZE );
    234243        success = !tr_ioRead( tor, pieceIndex, offset, len, buf );
    235244        if( !success )
Note: See TracChangeset for help on using the changeset viewer.