/ Check-in [750bb0a0]
Login

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

Overview
Comment:Change a while-loop into a do-loop in sqlite3VdbeSerialPut() for a small size reduction and performance improvement.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 750bb0a0960606ab24037e0992e9f7a17524cc3e
User & Date: drh 2014-08-22 13:22:32
Context
2014-08-22
15:19
Improve the performance and reduce the size of the sqlite3VdbeSerialGet() routine by avoiding the use of stack. check-in: ebc10e46 user: drh tags: trunk
14:34
Get the sqlite3VdbeSerialGet() routine to run faster by avoiding the use of local variables. check-in: 8267d821 user: drh tags: experimental
13:22
Change a while-loop into a do-loop in sqlite3VdbeSerialPut() for a small size reduction and performance improvement. check-in: 750bb0a0 user: drh tags: trunk
11:11
Enhance the spellfix extension with the ability to specify a rowid when inserting new rows. check-in: 369c480c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeaux.c.

  2929   2929         assert( sizeof(v)==sizeof(pMem->r) );
  2930   2930         memcpy(&v, &pMem->r, sizeof(v));
  2931   2931         swapMixedEndianFloat(v);
  2932   2932       }else{
  2933   2933         v = pMem->u.i;
  2934   2934       }
  2935   2935       len = i = sqlite3VdbeSerialTypeLen(serial_type);
  2936         -    while( i-- ){
  2937         -      buf[i] = (u8)(v&0xFF);
         2936  +    assert( i>0 );
         2937  +    do{
         2938  +      buf[--i] = (u8)(v&0xFF);
  2938   2939         v >>= 8;
  2939         -    }
         2940  +    }while( i );
  2940   2941       return len;
  2941   2942     }
  2942   2943   
  2943   2944     /* String or blob */
  2944   2945     if( serial_type>=12 ){
  2945   2946       assert( pMem->n + ((pMem->flags & MEM_Zero)?pMem->u.nZero:0)
  2946   2947                == (int)sqlite3VdbeSerialTypeLen(serial_type) );