/ Check-in [1c6ee9b8]
Login

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

Overview
Comment:In the OP_MakeRecord opcode, factor out affinity changes into separate loop, for a slight performance advantage.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1c6ee9b85f61e5cdb5d9b7815cddf526dc78aaa7
User & Date: drh 2013-12-10 20:53:01
Context
2013-12-10
21:38
Avoid unnecessary calls to sqlite3VdbeSerialType() from within sqlite3VdbeSerialPut(). check-in: 079c04a5 user: drh tags: trunk
20:53
In the OP_MakeRecord opcode, factor out affinity changes into separate loop, for a slight performance advantage. check-in: 1c6ee9b8 user: drh tags: trunk
19:49
Simplify and improve the performance of the sqlite3VdbeMemGrow() routine. check-in: 48ecf187 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

2590
2591
2592
2593
2594
2595
2596










2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
  pLast = &pData0[nField-1];
  file_format = p->minWriteFileFormat;

  /* Identify the output register */
  assert( pOp->p3<pOp->p1 || pOp->p3>=pOp->p1+pOp->p2 );
  pOut = &aMem[pOp->p3];
  memAboutToChange(p, pOut);











  /* Loop through the elements that will make up the record to figure
  ** out how much space is required for the new record.
  */
  assert( pData0<=pLast );
  pRec = pLast;
  do{
    assert( memIsValid(pRec) );
    if( zAffinity ){
      applyAffinity(pRec, zAffinity[pRec-pData0], encoding);
    }
    serial_type = sqlite3VdbeSerialType(pRec, file_format);
    len = sqlite3VdbeSerialTypeLen(serial_type);
    if( pRec->flags & MEM_Zero ){
      if( nData ){
        sqlite3VdbeMemExpandBlob(pRec);
      }else{
        nZero += pRec->u.nZero;







>
>
>
>
>
>
>
>
>
>




<



<
<
<







2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610

2611
2612
2613



2614
2615
2616
2617
2618
2619
2620
  pLast = &pData0[nField-1];
  file_format = p->minWriteFileFormat;

  /* Identify the output register */
  assert( pOp->p3<pOp->p1 || pOp->p3>=pOp->p1+pOp->p2 );
  pOut = &aMem[pOp->p3];
  memAboutToChange(p, pOut);

  /* Apply the requested affinity to all inputs
  */
  assert( pData0<=pLast );
  if( zAffinity ){
    pRec = pData0;
    do{
      applyAffinity(pRec, *(zAffinity++), encoding);
    }while( (++pRec)<=pLast );
  }

  /* Loop through the elements that will make up the record to figure
  ** out how much space is required for the new record.
  */

  pRec = pLast;
  do{
    assert( memIsValid(pRec) );



    serial_type = sqlite3VdbeSerialType(pRec, file_format);
    len = sqlite3VdbeSerialTypeLen(serial_type);
    if( pRec->flags & MEM_Zero ){
      if( nData ){
        sqlite3VdbeMemExpandBlob(pRec);
      }else{
        nZero += pRec->u.nZero;