/ Check-in [b890eefd]
Login

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

Overview
Comment:A simple change to the OP_Function opcode improves overall performance by about 0.5%.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:b890eefd57fbd189f7df611e82eb1fb4b197e1c3
User & Date: drh 2013-11-21 03:43:12
Context
2013-11-21
04:18
Another improvement to OP_Function and an improvement to OP_Move. check-in: 70b056fb user: drh tags: trunk
03:43
A simple change to the OP_Function opcode improves overall performance by about 0.5%. check-in: b890eefd user: drh tags: trunk
03:12
Performance optimization to the OP_Next and OP_Prev opcodes. check-in: ecaac28a user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbe.c.

  1483   1483       Deephemeralize(pArg);
  1484   1484       sqlite3VdbeMemStoreType(pArg);
  1485   1485       REGISTER_TRACE(pOp->p2+i, pArg);
  1486   1486     }
  1487   1487   
  1488   1488     assert( pOp->p4type==P4_FUNCDEF );
  1489   1489     ctx.pFunc = pOp->p4.pFunc;
  1490         -  ctx.s.flags = MEM_Null;
  1491         -  ctx.s.db = db;
  1492         -  ctx.s.xDel = 0;
  1493         -  ctx.s.zMalloc = 0;
  1494   1490     ctx.iOp = pc;
  1495   1491     ctx.pVdbe = p;
  1496   1492   
  1497   1493     /* The output cell may already have a buffer allocated. Move
  1498   1494     ** the pointer to ctx.s so in case the user-function can use
  1499   1495     ** the already allocated buffer instead of allocating a new one.
  1500   1496     */
  1501         -  sqlite3VdbeMemMove(&ctx.s, pOut);
         1497  +  memcpy(&ctx.s, pOut, sizeof(Mem));
         1498  +  pOut->flags = MEM_Null;
         1499  +  pOut->xDel = 0;
         1500  +  pOut->zMalloc = 0;
  1502   1501     MemSetTypeFlag(&ctx.s, MEM_Null);
  1503   1502   
  1504   1503     ctx.fErrorOrAux = 0;
  1505   1504     if( ctx.pFunc->funcFlags & SQLITE_FUNC_NEEDCOLL ){
  1506   1505       assert( pOp>aOp );
  1507   1506       assert( pOp[-1].p4type==P4_COLLSEQ );
  1508   1507       assert( pOp[-1].opcode==OP_CollSeq );