Changeset 156


Ignore:
Timestamp:
06/08/10 11:49:59 (3 years ago)
Author:
faltet
Message:

Refined the multi-domain algorithm for taking just multiples of cache size.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/blosc.c

    r155 r156  
    634634 
    635635  if (*flags & BLOSC_MEMCPYED) { 
    636     if ((nbytes > 64*KB) || (nthreads > 1)) { 
    637       /* More effective in multi-core processors or large buffers */ 
     636    if (((nbytes % L1) == 0) || (nthreads > 1)) { 
     637      /* More effective with large buffers that are multiples of the 
     638       cache size or multi-cores */ 
    638639      params.ntbytes = BLOSC_MAX_OVERHEAD; 
    639640      ntbytes = do_job(); 
    640641    } 
    641642    else { 
    642       /* More effective in single-core processors or small buffers */ 
    643643      memcpy(dest+BLOSC_MAX_OVERHEAD, src, nbytes); 
    644644      ntbytes = nbytes + BLOSC_MAX_OVERHEAD; 
     
    722722  /* Check whether this buffer is memcpy'ed */ 
    723723  if (flags & BLOSC_MEMCPYED) { 
    724     if ((nbytes > 64*KB) || (nthreads > 1)) { 
    725       /* More effective in multi-core processors or large buffers */ 
     724    if (((nbytes % L1) == 0) || (nthreads > 1)) { 
     725      /* More effective with large buffers that are multiples of the 
     726       cache size or multi-cores */ 
    726727      ntbytes = do_job(); 
    727728    } 
    728729    else { 
    729       /* More effective in single-core processors or small buffers */ 
    730730      memcpy(dest, src+BLOSC_MAX_OVERHEAD, nbytes); 
    731731      ntbytes = nbytes; 
Note: See TracChangeset for help on using the changeset viewer.