SQLite

Check-in [c45cd3b947]
Login

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

Overview
Comment:Minor performance enhancements to the OP_Affinity opcode.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c45cd3b947c0f03a688f827fddb4629a986788f0dd98d5ef899f11e68ff1c202
User & Date: drh 2017-04-01 20:14:01.312
Context
2017-04-01
20:44
Remove an unnecessary setting of the Mem.enc field for the output of the OP_Record opcode, for a performance improvement and size reduction. (check-in: e6e36b288f user: drh tags: trunk)
20:14
Minor performance enhancements to the OP_Affinity opcode. (check-in: c45cd3b947 user: drh tags: trunk)
19:45
Remove an unnecessary clearing of the Vdbe.iCurrentTime value. (check-in: fcd2acdd60 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbe.c.
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716

2717
2718
2719

2720
2721
2722
2723
2724

2725
2726
2727
2728
2729
2730
2731
**
** P4 is a string that is P2 characters long. The nth character of the
** string indicates the column affinity that should be used for the nth
** memory cell in the range.
*/
case OP_Affinity: {
  const char *zAffinity;   /* The affinity to be applied */
  char cAff;               /* A single character of affinity */

  zAffinity = pOp->p4.z;
  assert( zAffinity!=0 );

  assert( zAffinity[pOp->p2]==0 );
  pIn1 = &aMem[pOp->p1];
  while( (cAff = *(zAffinity++))!=0 ){

    assert( pIn1 <= &p->aMem[(p->nMem+1 - p->nCursor)] );
    assert( memIsValid(pIn1) );
    applyAffinity(pIn1, cAff, encoding);
    pIn1++;
  }

  break;
}

/* Opcode: MakeRecord P1 P2 P3 P4 *
** Synopsis: r[P3]=mkrec(r[P1@P2])
**
** Convert P2 registers beginning with P1 into the [record format]







<



>


<
>


|

<
>







2706
2707
2708
2709
2710
2711
2712

2713
2714
2715
2716
2717
2718

2719
2720
2721
2722
2723

2724
2725
2726
2727
2728
2729
2730
2731
**
** P4 is a string that is P2 characters long. The nth character of the
** string indicates the column affinity that should be used for the nth
** memory cell in the range.
*/
case OP_Affinity: {
  const char *zAffinity;   /* The affinity to be applied */


  zAffinity = pOp->p4.z;
  assert( zAffinity!=0 );
  assert( pOp->p2>0 );
  assert( zAffinity[pOp->p2]==0 );
  pIn1 = &aMem[pOp->p1];

  do{
    assert( pIn1 <= &p->aMem[(p->nMem+1 - p->nCursor)] );
    assert( memIsValid(pIn1) );
    applyAffinity(pIn1, *(zAffinity++), encoding);
    pIn1++;

  }while( zAffinity[0] );
  break;
}

/* Opcode: MakeRecord P1 P2 P3 P4 *
** Synopsis: r[P3]=mkrec(r[P1@P2])
**
** Convert P2 registers beginning with P1 into the [record format]