]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
make it a little faster (CVS 160)
authordrh <drh@noemail.net>
Thu, 19 Oct 2000 14:42:04 +0000 (14:42 +0000)
committerdrh <drh@noemail.net>
Thu, 19 Oct 2000 14:42:04 +0000 (14:42 +0000)
FossilOrigin-Name: 757668bd641134a6f7479c8df1c8b06a24d51ee4

manifest
manifest.uuid
src/vdbe.c

index 315e92323a6b1be5941e6a154abdbb4dfba8e5b9..cfdde9ba964051496e34f48823cf2a44c91d41d6 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C add\sthe\ssqlite_test_prefixes\scontrol\sfile\s(CVS\s159)
-D 2000-10-19T14:21:43
+C make\sit\sa\slittle\sfaster\s(CVS\s160)
+D 2000-10-19T14:42:05
 F COPYRIGHT 74a8a6531a42e124df07ab5599aad63870fa0bd4
 F Makefile.in 0b1fdafa55e1bf4d3a4f5213544130e66ef32052
 F README 51f6a4e7408b34afa5bc1c0485f61b6a4efb6958
@@ -28,7 +28,7 @@ F src/tclsqlite.c 44b08b47612a668caaf7c4ec32133b69d73ff78e
 F src/tokenize.c b0f5c12598105ec924c0733a916485f920168720
 F src/update.c 51b9ef7434b15e31096155da920302e9db0d27fc
 F src/util.c 811e0ad47f842c16555aaf361b26dab7221c1a6c
-F src/vdbe.c a876c75429903acb9167b741b0513ef0198f6001
+F src/vdbe.c 45d40d614a48208b560e6285197cece75dbd61a4
 F src/vdbe.h 140cdec3c56f70483e169f8ae657bd90f9fd6e98
 F src/where.c 3dfad2ffd0aa994d5eceac88852f7189c8d1d3c8
 F test/all.test 71d439d4d8d5bb68ca73344ce6d2b1ebb35ab7dd
@@ -76,7 +76,7 @@ F www/opcode.tcl cb3a1abf8b7b9be9f3a228d097d6bf8b742c2b6f
 F www/sqlite.tcl cb0d23d8f061a80543928755ec7775da6e4f362f
 F www/tclsqlite.tcl ae101d5f7c07dcc59770e2a84aae09025fab2dad
 F www/vdbe.tcl bcbfc33bcdd0ebad95eab31286adb9e1bc289520
-P 948f5a749fdc7f40f8a8e5a4e5be8139f9e4c66d
-R e79bb9b290cec447f3f3f47b8c2dfcaa
+P 4ccd9103c3e7236084283a7311b6e746037d12aa
+R 6178bf880777b292ca5925307641dd4d
 U drh
-Z c6b0e812334b90035c7213ccc2b20570
+Z 3c6d10f29cae80e365fba2fc79dd5292
index fa507b8cd30bf99c0966aaa646962d0cc0f5db72..c62d6d7cc9d21d941bf72102c3d0926d81f24bf5 100644 (file)
@@ -1 +1 @@
-4ccd9103c3e7236084283a7311b6e746037d12aa
\ No newline at end of file
+757668bd641134a6f7479c8df1c8b06a24d51ee4
\ No newline at end of file
index da27f4b47fbed0f5c9336193efa4230780f0a207..45e976dfce3a6a5338829e0bb0ff2b76ce19547a 100644 (file)
@@ -41,7 +41,7 @@
 ** But other routines are also provided to help in building up
 ** 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 <unistd.h>
@@ -547,22 +547,24 @@ static int SetTest(Set *p, char *zKey){
 #define Stringify(P,I) \
    ((P->aStack[I].flags & STK_Str)==0 ? hardStringify(P,I) : 0)
 static int hardStringify(Vdbe *p, int i){
+  Stack *pStack = &p->aStack[i];
+  char **pzStack = &p->zStack[i];
   char zBuf[30];
-  int fg = p->aStack[i].flags;
+  int fg = pStack->flags;
   if( fg & STK_Real ){
-    sprintf(zBuf,"%.15g",p->aStack[i].r);
+    sprintf(zBuf,"%.15g",pStack->r);
   }else if( fg & STK_Int ){
-    sprintf(zBuf,"%d",p->aStack[i].i);
+    sprintf(zBuf,"%d",pStack->i);
   }else{
     p->zStack[i] = "";
-    p->aStack[i].n = 1;
-    p->aStack[i].flags |= STK_Str;
+    pStack->n = 1;
+    pStack->flags |= STK_Str;
     return 0;
   }
-  p->zStack[i] = sqliteStrDup(zBuf);
-  if( p->zStack[i]==0 ) return 1;
-  p->aStack[i].n = strlen(p->zStack[i])+1;
-  p->aStack[i].flags |= STK_Str|STK_Dyn;
+  *pzStack = sqliteStrDup(zBuf);
+  if( *pzStack==0 ) return 1;
+  pStack->n = strlen(*pzStack)+1;
+  pStack->flags |= STK_Str|STK_Dyn;
   return 0;
 }
 
@@ -622,7 +624,22 @@ static void hardRealify(Vdbe *p, int i){
 ** popped stack elements.
 */
 static void PopStack(Vdbe *p, int N){
+  char **pzStack;
+  Stack *pStack;
   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 ){
     int i = p->tos--;
     if( p->aStack[i].flags & STK_Dyn ){
@@ -630,7 +647,8 @@ static void PopStack(Vdbe *p, int N){
     }
     p->aStack[i].flags = 0;
     p->zStack[i] = 0;
-  }    
+  }
+#endif  
 }
 
 /*