diff options
author | drh <drh@noemail.net> | 2019-07-11 19:22:36 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-07-11 19:22:36 +0000 |
commit | c1da4397d6920ebdefbf4eeaf35c780f5478c6fb (patch) | |
tree | 5bd9f9f0627429d64578228ea38f5eefe3618a5b /src/vdbeaux.c | |
parent | ea7e83b7806773bf6a2c60786ff8f95b218d4622 (diff) | |
download | sqlite-c1da4397d6920ebdefbf4eeaf35c780f5478c6fb.tar.gz sqlite-c1da4397d6920ebdefbf4eeaf35c780f5478c6fb.zip |
Move the sqlite3VdbeSerialType() routine in-line in the OP_MakeRecord opcode.
Optimizing compilers were doing this already. By doing it manually, we can
omit some redundant tests and make the whole thing run a million cycles faster
and use about 80 bytes less code space.
FossilOrigin-Name: d837ab0da52632699abc09320980606aef020df5020c253f99c97e24bf3c6d00
Diffstat (limited to 'src/vdbeaux.c')
-rw-r--r-- | src/vdbeaux.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c index 8dd2b421a..c21d7db40 100644 --- a/src/vdbeaux.c +++ b/src/vdbeaux.c @@ -3430,10 +3430,16 @@ int sqlite3VdbeCursorMoveto(VdbeCursor **pp, int *piCol){ ** of SQLite will not understand those serial types. */ +#ifdef SQLITE_ENABLE_STAT3_OR_STAT4 /* ** Return the serial-type for the value stored in pMem. ** ** This routine might convert a large MEM_IntReal value into MEM_Real. +** +** 2019-07-11: The primary user of this subroutine was the OP_MakeRecord +** opcode in the byte-code engine. But by moving this routine in-line, we +** can omit some redundant tests and make that opcode a lot faster. So +** this routine is now only used by the STAT3/4 logic. */ u32 sqlite3VdbeSerialType(Mem *pMem, int file_format, u32 *pLen){ int flags = pMem->flags; @@ -3494,6 +3500,7 @@ u32 sqlite3VdbeSerialType(Mem *pMem, int file_format, u32 *pLen){ *pLen = n; return ((n*2) + 12 + ((flags&MEM_Str)!=0)); } +#endif /* SQLITE_ENABLE_STAT3_OR_STAT4 */ /* ** The sizes for serial types less than 128 |