mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Reorder the elements of the Mem object for a small size reduction and
performance improvement. FossilOrigin-Name: 0be3019ed794c10de67dfd645ceea7d45815bc4b
This commit is contained in:
20
manifest
20
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Changes\sto\ssqlite3VdbeRecordUnpack()\sto\smake\sit\sslightly\ssmaller\sand\sfaster.
|
C Reorder\sthe\selements\sof\sthe\sMem\sobject\sfor\sa\ssmall\ssize\sreduction\sand\nperformance\simprovement.
|
||||||
D 2014-09-16T13:30:05.468
|
D 2014-09-16T14:16:31.846
|
||||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||||
F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a
|
F Makefile.in cf57f673d77606ab0f2d9627ca52a9ba1464146a
|
||||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||||
@@ -183,7 +183,7 @@ F src/delete.c fae81cc2eb14b75267d4f47d3cfc9ae02aae726f
|
|||||||
F src/expr.c 19392d98e089640c3336e65b4254cc337efef7d1
|
F src/expr.c 19392d98e089640c3336e65b4254cc337efef7d1
|
||||||
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
|
F src/fault.c 160a0c015b6c2629d3899ed2daf63d75754a32bb
|
||||||
F src/fkey.c da985ae673efef2c712caef825a5d2edb087ead7
|
F src/fkey.c da985ae673efef2c712caef825a5d2edb087ead7
|
||||||
F src/func.c 5d498933f6168dff80941c873805fe04dc2b766d
|
F src/func.c 1629ccdd8ef3f19d7accc9d9287190489469ff81
|
||||||
F src/global.c 5110fa12e09729b84eee0191c984ec4008e21937
|
F src/global.c 5110fa12e09729b84eee0191c984ec4008e21937
|
||||||
F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5
|
F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5
|
||||||
F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094
|
F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094
|
||||||
@@ -290,11 +290,11 @@ F src/util.c 4006c01772bd8d8ac4306d523bbcee41d3e392d8
|
|||||||
F src/vacuum.c 59f03f92bcff57faa6a8ca256eb29ccddfb0614a
|
F src/vacuum.c 59f03f92bcff57faa6a8ca256eb29ccddfb0614a
|
||||||
F src/vdbe.c 9a45dcbcc967fc0cb9248c75ba245d1d47de3e78
|
F src/vdbe.c 9a45dcbcc967fc0cb9248c75ba245d1d47de3e78
|
||||||
F src/vdbe.h c63fad052c9e7388d551e556e119c0bcf6bebdf8
|
F src/vdbe.h c63fad052c9e7388d551e556e119c0bcf6bebdf8
|
||||||
F src/vdbeInt.h b4843c35c3ba533b69d4250f550b5bacf2fb013d
|
F src/vdbeInt.h 0de8705e38b5f28808e37cebb9ec6df995ac3304
|
||||||
F src/vdbeapi.c 06b712d4772b318b69cd37a416deb1ff0426aa8c
|
F src/vdbeapi.c 4d2aa56efa1b4a010012466bf8e97dbf179081a6
|
||||||
F src/vdbeaux.c 2f284f8b052acc5b484682fbd3de35c990c2ca1c
|
F src/vdbeaux.c 4d607ce804cc4ee129df5745f7b73ed472f808b6
|
||||||
F src/vdbeblob.c 848238dc73e93e48432991bb5651bf87d865eca4
|
F src/vdbeblob.c 848238dc73e93e48432991bb5651bf87d865eca4
|
||||||
F src/vdbemem.c dc36ea9fe26c25550c50085f388167086ef7d73a
|
F src/vdbemem.c 4d1e1398be24f85805196c20a80699be0699a9ca
|
||||||
F src/vdbesort.c a7a40ceca6325b853040ffcc363dcd49a45f201b
|
F src/vdbesort.c a7a40ceca6325b853040ffcc363dcd49a45f201b
|
||||||
F src/vdbetrace.c 16d39c1ef7d1f4a3a7464bea3b7b4bdd7849c415
|
F src/vdbetrace.c 16d39c1ef7d1f4a3a7464bea3b7b4bdd7849c415
|
||||||
F src/vtab.c 019dbfd0406a7447c990e1f7bd1dfcdb8895697f
|
F src/vtab.c 019dbfd0406a7447c990e1f7bd1dfcdb8895697f
|
||||||
@@ -1198,7 +1198,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
|||||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||||
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
||||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||||
P 20ed2321b09ba076e50f9fc2f42c135b25746d72
|
P 8fb90da77ce0e662c1ef1ae0d854e5164494b7af
|
||||||
R 052add0d7794460f3fc0b9bdb3e7879a
|
R 66ed6d98b57d603d2a5f34403ecc91fe
|
||||||
U drh
|
U drh
|
||||||
Z bf1aaf6028da77cf4241e813f52ee696
|
Z d53857782fade1fcfcd0d6fed6dee986
|
||||||
|
@@ -1 +1 @@
|
|||||||
8fb90da77ce0e662c1ef1ae0d854e5164494b7af
|
0be3019ed794c10de67dfd645ceea7d45815bc4b
|
@@ -1492,6 +1492,7 @@ static void minmaxStep(
|
|||||||
sqlite3SkipAccumulatorLoad(context);
|
sqlite3SkipAccumulatorLoad(context);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
pBest->db = sqlite3_context_db_handle(context);
|
||||||
sqlite3VdbeMemCopy(pBest, pArg);
|
sqlite3VdbeMemCopy(pBest, pArg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -161,9 +161,6 @@ struct VdbeFrame {
|
|||||||
** integer etc.) of the same value.
|
** integer etc.) of the same value.
|
||||||
*/
|
*/
|
||||||
struct Mem {
|
struct Mem {
|
||||||
sqlite3 *db; /* The associated database connection */
|
|
||||||
char *z; /* String or BLOB value */
|
|
||||||
double r; /* Real value */
|
|
||||||
union {
|
union {
|
||||||
i64 i; /* Integer value used when MEM_Int is set in flags */
|
i64 i; /* Integer value used when MEM_Int is set in flags */
|
||||||
int nZero; /* Used when bit MEM_Zero is set in flags */
|
int nZero; /* Used when bit MEM_Zero is set in flags */
|
||||||
@@ -171,15 +168,19 @@ struct Mem {
|
|||||||
RowSet *pRowSet; /* Used only when flags==MEM_RowSet */
|
RowSet *pRowSet; /* Used only when flags==MEM_RowSet */
|
||||||
VdbeFrame *pFrame; /* Used when flags==MEM_Frame */
|
VdbeFrame *pFrame; /* Used when flags==MEM_Frame */
|
||||||
} u;
|
} u;
|
||||||
int n; /* Number of characters in string value, excluding '\0' */
|
|
||||||
u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
|
u16 flags; /* Some combination of MEM_Null, MEM_Str, MEM_Dyn, etc. */
|
||||||
u8 enc; /* SQLITE_UTF8, SQLITE_UTF16BE, SQLITE_UTF16LE */
|
u8 enc; /* SQLITE_UTF8, SQLITE_UTF16BE, SQLITE_UTF16LE */
|
||||||
|
int n; /* Number of characters in string value, excluding '\0' */
|
||||||
|
double r; /* Real value */
|
||||||
|
char *z; /* String or BLOB value */
|
||||||
|
char *zMalloc; /* Dynamic buffer allocated by sqlite3_malloc() */
|
||||||
|
/* ShallowCopy only needs to copy the information above */
|
||||||
|
sqlite3 *db; /* The associated database connection */
|
||||||
|
void (*xDel)(void*);/* If not null, call this function to delete Mem.z */
|
||||||
#ifdef SQLITE_DEBUG
|
#ifdef SQLITE_DEBUG
|
||||||
Mem *pScopyFrom; /* This Mem is a shallow copy of pScopyFrom */
|
Mem *pScopyFrom; /* This Mem is a shallow copy of pScopyFrom */
|
||||||
void *pFiller; /* So that sizeof(Mem) is a multiple of 8 */
|
void *pFiller; /* So that sizeof(Mem) is a multiple of 8 */
|
||||||
#endif
|
#endif
|
||||||
void (*xDel)(void *); /* If not null, call this function to delete Mem.z */
|
|
||||||
char *zMalloc; /* Dynamic buffer allocated by sqlite3_malloc() */
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* One or more of the following flags are set to indicate the validOK
|
/* One or more of the following flags are set to indicate the validOK
|
||||||
|
@@ -803,11 +803,21 @@ static const Mem *columnNullValue(void){
|
|||||||
#if defined(SQLITE_DEBUG) && defined(__GNUC__)
|
#if defined(SQLITE_DEBUG) && defined(__GNUC__)
|
||||||
__attribute__((aligned(8)))
|
__attribute__((aligned(8)))
|
||||||
#endif
|
#endif
|
||||||
= {0, "", (double)0, {0}, 0, MEM_Null, 0,
|
= {
|
||||||
|
.flags = MEM_Null,
|
||||||
|
.enc = 0,
|
||||||
|
.n = 0,
|
||||||
|
.r = (double)0,
|
||||||
|
.u = {0},
|
||||||
|
.z = 0,
|
||||||
|
.zMalloc = 0,
|
||||||
|
.db = 0,
|
||||||
|
.xDel = 0,
|
||||||
#ifdef SQLITE_DEBUG
|
#ifdef SQLITE_DEBUG
|
||||||
0, 0, /* pScopyFrom, pFiller */
|
.pScopyFrom = 0,
|
||||||
|
.pFiller = 0,
|
||||||
#endif
|
#endif
|
||||||
0, 0 };
|
};
|
||||||
return &nullMem;
|
return &nullMem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3303,8 +3303,9 @@ static int vdbeCompareMemString(
|
|||||||
int n1, n2;
|
int n1, n2;
|
||||||
Mem c1;
|
Mem c1;
|
||||||
Mem c2;
|
Mem c2;
|
||||||
memset(&c1, 0, sizeof(c1));
|
c1.db = c2.db = pMem1->db;
|
||||||
memset(&c2, 0, sizeof(c2));
|
c1.flags = c2.flags = 0;
|
||||||
|
c1.zMalloc = c2.zMalloc = 0;
|
||||||
sqlite3VdbeMemShallowCopy(&c1, pMem1, MEM_Ephem);
|
sqlite3VdbeMemShallowCopy(&c1, pMem1, MEM_Ephem);
|
||||||
sqlite3VdbeMemShallowCopy(&c2, pMem2, MEM_Ephem);
|
sqlite3VdbeMemShallowCopy(&c2, pMem2, MEM_Ephem);
|
||||||
v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);
|
v1 = sqlite3ValueText((sqlite3_value*)&c1, pColl->enc);
|
||||||
|
@@ -730,6 +730,7 @@ void sqlite3VdbeMemAboutToChange(Vdbe *pVdbe, Mem *pMem){
|
|||||||
*/
|
*/
|
||||||
void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){
|
void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){
|
||||||
assert( (pFrom->flags & MEM_RowSet)==0 );
|
assert( (pFrom->flags & MEM_RowSet)==0 );
|
||||||
|
assert( pTo->db==pFrom->db );
|
||||||
VdbeMemReleaseExtern(pTo);
|
VdbeMemReleaseExtern(pTo);
|
||||||
memcpy(pTo, pFrom, MEMCELLSIZE);
|
memcpy(pTo, pFrom, MEMCELLSIZE);
|
||||||
pTo->xDel = 0;
|
pTo->xDel = 0;
|
||||||
@@ -747,6 +748,7 @@ void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){
|
|||||||
int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
|
int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){
|
||||||
int rc = SQLITE_OK;
|
int rc = SQLITE_OK;
|
||||||
|
|
||||||
|
assert( pTo->db==pFrom->db );
|
||||||
assert( (pFrom->flags & MEM_RowSet)==0 );
|
assert( (pFrom->flags & MEM_RowSet)==0 );
|
||||||
VdbeMemReleaseExtern(pTo);
|
VdbeMemReleaseExtern(pTo);
|
||||||
memcpy(pTo, pFrom, MEMCELLSIZE);
|
memcpy(pTo, pFrom, MEMCELLSIZE);
|
||||||
|
Reference in New Issue
Block a user