/ Check-in [46bd9533]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Experimental patch restore the slight bias in btree-balancing immediately after the change to reduces the amount of memcpy() work done by balancing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | btree-balance-bias
Files: files | file ages | folders
SHA1: 46bd9533c0b4656e9fb10eb41c9369ba8a113746
User & Date: drh 2016-07-14 20:19:24
Context
2016-07-16
11:47
Temporarily add extra sqlite3_log() calls to this version to help with debugging a performance problem. check-in: 613c1cea user: dan tags: debug
2016-07-14
20:19
Experimental patch restore the slight bias in btree-balancing immediately after the change to reduces the amount of memcpy() work done by balancing. Leaf check-in: 46bd9533 user: drh tags: btree-balance-bias
2014-10-27
14:26
Optimizations aimed at reducing the number of memcpy() operations required by balance_nonroot(). check-in: face33be user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/btree.c.

6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
    int d;              /* Index of first cell to the left of right sibling */

    r = cntNew[i-1] - 1;
    d = r + 1 - leafData;
    assert( d<nMaxCells );
    assert( r<nMaxCells );
    while( szRight==0 
       || (!bBulk && szRight+szCell[d]+2<=szLeft-(szCell[r]+2)) 
    ){
      szRight += szCell[d] + 2;
      szLeft -= szCell[r] + 2;
      cntNew[i-1]--;
      r = cntNew[i-1] - 1;
      d = r + 1 - leafData;
    }







|







6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
    int d;              /* Index of first cell to the left of right sibling */

    r = cntNew[i-1] - 1;
    d = r + 1 - leafData;
    assert( d<nMaxCells );
    assert( r<nMaxCells );
    while( szRight==0 
       || (!bBulk && szRight+szCell[d]+2<=szLeft-(szCell[r]+(i==k-1?0:2))) 
    ){
      szRight += szCell[d] + 2;
      szLeft -= szCell[r] + 2;
      cntNew[i-1]--;
      r = cntNew[i-1] - 1;
      d = r + 1 - leafData;
    }