1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

make it a little faster (CVS 160)

FossilOrigin-Name: 757668bd641134a6f7479c8df1c8b06a24d51ee4
This commit is contained in:
drh
2000-10-19 14:42:04 +00:00
parent 01d01eeee0
commit efa4e17240
3 changed files with 36 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
C add\sthe\ssqlite_test_prefixes\scontrol\sfile\s(CVS\s159) C make\sit\sa\slittle\sfaster\s(CVS\s160)
D 2000-10-19T14:21:43 D 2000-10-19T14:42:05
F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4 F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4
F Makefile.in 0b1fdafa55e1bf4d3a4f5213544130e66ef32052 F Makefile.in 0b1fdafa55e1bf4d3a4f5213544130e66ef32052
F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958 F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958
@@ -28,7 +28,7 @@ F src/tclsqlite.c 44b08b47612a668caaf7c4ec32133b69d73ff78e
F src/tokenize.c b0f5c12598105ec924c0733a916485f920168720 F src/tokenize.c b0f5c12598105ec924c0733a916485f920168720
F src/update.c 51b9ef7434b15e31096155da920302e9db0d27fc F src/update.c 51b9ef7434b15e31096155da920302e9db0d27fc
F src/util.c 811e0ad47f842c16555aaf361b26dab7221c1a6c F src/util.c 811e0ad47f842c16555aaf361b26dab7221c1a6c
F src/vdbe.c a876c75429903acb9167b741b0513ef0198f6001 F src/vdbe.c 45d40d614a48208b560e6285197cece75dbd61a4
F src/vdbe.h 140cdec3c56f70483e169f8ae657bd90f9fd6e98 F src/vdbe.h 140cdec3c56f70483e169f8ae657bd90f9fd6e98
F src/where.c 3dfad2ffd0aa994d5eceac88852f7189c8d1d3c8 F src/where.c 3dfad2ffd0aa994d5eceac88852f7189c8d1d3c8
F test/all.test 71d439d4d8d5bb68ca73344ce6d2b1ebb35ab7dd F test/all.test 71d439d4d8d5bb68ca73344ce6d2b1ebb35ab7dd
@@ -76,7 +76,7 @@ F www/opcode.tcl cb3a1abf8b7b9be9f3a228d097d6bf8b742c2b6f
F www/sqlite.tcl cb0d23d8f061a80543928755ec7775da6e4f362f F www/sqlite.tcl cb0d23d8f061a80543928755ec7775da6e4f362f
F www/tclsqlite.tcl ae101d5f7c07dcc59770e2a84aae09025fab2dad F www/tclsqlite.tcl ae101d5f7c07dcc59770e2a84aae09025fab2dad
F www/vdbe.tcl bcbfc33bcdd0ebad95eab31286adb9e1bc289520 F www/vdbe.tcl bcbfc33bcdd0ebad95eab31286adb9e1bc289520
P 948f5a749fdc7f40f8a8e5a4e5be8139f9e4c66d P 4ccd9103c3e7236084283a7311b6e746037d12aa
R e79bb9b290cec447f3f3f47b8c2dfcaa R 6178bf880777b292ca5925307641dd4d
U drh U drh
Z c6b0e812334b90035c7213ccc2b20570 Z 3c6d10f29cae80e365fba2fc79dd5292

View File

@@ -1 +1 @@
4ccd9103c3e7236084283a7311b6e746037d12aa 757668bd641134a6f7479c8df1c8b06a24d51ee4

View File

@@ -41,7 +41,7 @@
** But other routines are also provided to help in building up ** But other routines are also provided to help in building up
** a program instruction by instruction. ** a program instruction by instruction.
** **
** $Id: vdbe.c,v 1.44 2000/10/19 01:49:03 drh Exp $ ** $Id: vdbe.c,v 1.45 2000/10/19 14:42:05 drh Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <unistd.h> #include <unistd.h>
@@ -547,22 +547,24 @@ static int SetTest(Set *p, char *zKey){
#define Stringify(P,I) \ #define Stringify(P,I) \
((P->aStack[I].flags & STK_Str)==0 ? hardStringify(P,I) : 0) ((P->aStack[I].flags & STK_Str)==0 ? hardStringify(P,I) : 0)
static int hardStringify(Vdbe *p, int i){ static int hardStringify(Vdbe *p, int i){
Stack *pStack = &p->aStack[i];
char **pzStack = &p->zStack[i];
char zBuf[30]; char zBuf[30];
int fg = p->aStack[i].flags; int fg = pStack->flags;
if( fg & STK_Real ){ if( fg & STK_Real ){
sprintf(zBuf,"%.15g",p->aStack[i].r); sprintf(zBuf,"%.15g",pStack->r);
}else if( fg & STK_Int ){ }else if( fg & STK_Int ){
sprintf(zBuf,"%d",p->aStack[i].i); sprintf(zBuf,"%d",pStack->i);
}else{ }else{
p->zStack[i] = ""; p->zStack[i] = "";
p->aStack[i].n = 1; pStack->n = 1;
p->aStack[i].flags |= STK_Str; pStack->flags |= STK_Str;
return 0; return 0;
} }
p->zStack[i] = sqliteStrDup(zBuf); *pzStack = sqliteStrDup(zBuf);
if( p->zStack[i]==0 ) return 1; if( *pzStack==0 ) return 1;
p->aStack[i].n = strlen(p->zStack[i])+1; pStack->n = strlen(*pzStack)+1;
p->aStack[i].flags |= STK_Str|STK_Dyn; pStack->flags |= STK_Str|STK_Dyn;
return 0; return 0;
} }
@@ -622,7 +624,22 @@ static void hardRealify(Vdbe *p, int i){
** popped stack elements. ** popped stack elements.
*/ */
static void PopStack(Vdbe *p, int N){ static void PopStack(Vdbe *p, int N){
char **pzStack;
Stack *pStack;
if( p->zStack==0 ) return; if( p->zStack==0 ) return;
pStack = &p->aStack[p->tos];
pzStack = &p->zStack[p->tos];
p->tos -= N;
while( N-- > 0 ){
if( pStack->flags & STK_Dyn ){
sqliteFree(*pzStack);
}
pStack->flags = 0;
*pzStack = 0;
pStack--;
pzStack--;
}
#if 0 /* Older code was a little slower */
while( p->tos>=0 && N-->0 ){ while( p->tos>=0 && N-->0 ){
int i = p->tos--; int i = p->tos--;
if( p->aStack[i].flags & STK_Dyn ){ if( p->aStack[i].flags & STK_Dyn ){
@@ -631,6 +648,7 @@ static void PopStack(Vdbe *p, int N){
p->aStack[i].flags = 0; p->aStack[i].flags = 0;
p->zStack[i] = 0; p->zStack[i] = 0;
} }
#endif
} }
/* /*