From 5f4bcf15d1da41999757af02cd1e0509176696cb Mon Sep 17 00:00:00 2001 From: drh Date: Tue, 29 Jul 2008 14:29:06 +0000 Subject: [PATCH] Enhancements to the pagecache malloc test configuration. Changes to the speed test scripts to use the new test enhancements. (CVS 5494) FossilOrigin-Name: 0ce39c21f32958ae53c00dc8bbf8cdd453f2d90e --- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/malloc.c | 4 ++-- src/test_malloc.c | 16 +++++++++------- test/speed1.test | 3 ++- test/speed1p.test | 6 ++++-- 6 files changed, 27 insertions(+), 22 deletions(-) diff --git a/manifest b/manifest index d3543ebd60..e06ff59779 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Increase\sthe\sversion\snumber\sto\s3.6.1.\s(CVS\s5493) -D 2008-07-29T14:28:04 +C Enhancements\sto\sthe\spagecache\smalloc\stest\sconfiguration.\s\sChanges\sto\sthe\nspeed\stest\sscripts\sto\suse\sthe\snew\stest\senhancements.\s(CVS\s5494) +D 2008-07-29T14:29:07 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0 F Makefile.in bbb62eecc851379aef5a48a1bf8787eb13e6ec06 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654 @@ -116,7 +116,7 @@ F src/journal.c cffd2cd214e58c0e99c3ff632b3bee6c7cbb260e F src/legacy.c 3635cc6a5889918086b3501de8287cbbecb55917 F src/loadext.c 9ab55455f59dce0ae6388952216a1505ce7f9d13 F src/main.c 70d285dce241ad8daa320f78b060edb73bba637e -F src/malloc.c 2aa685ca13019d6c46d43516578596afefa59425 +F src/malloc.c 9359e52a3e8519a0584d3c90335ca4a76b1d90a8 F src/md5.c 008216bbb5d34c6fbab5357aa68575ad8a31516a F src/mem1.c 3a7fe31d8290baa3bb203af72f7dfd6323966bcd F src/mem2.c 87381b143530cc377592e868bd548e881c2498a3 @@ -168,7 +168,7 @@ F src/test_devsym.c 6012cb8e3acf812513511025a4fa5d626e0ba19b F src/test_func.c 24a556989685495013e08f311ae31c4ef86ddb8c F src/test_hexio.c 2f1122aa3f012fa0142ee3c36ce5c902a70cd12f F src/test_loadext.c df8ab3a6481ddebbdf0d28ebac5d9e0790f7860f -F src/test_malloc.c f760300736b923c98f5bb620a3146d31845e4acc +F src/test_malloc.c 398f670f29e2d0c7b7717e2ea6386693b29afa28 F src/test_md5.c 28209a4e2068711b5443c33104fe41f21d160071 F src/test_mutex.c d3422d9f60cc1330249d102e74b333f0d24a0cb6 F src/test_onefile.c 243157b10275251c5dc2d6619aee2ff9ae22379c @@ -474,9 +474,9 @@ F test/sidedelete.test 736ac1da08b3b1aa62df97fef2fcdb1b660111b9 F test/soak.test 3c317b3e55e1160731030c8e865d1858fab66fea F test/softheap1.test 73ebd6e020d2954d965da2072baba5922fc8fb6a F test/sort.test 0e4456e729e5a92a625907c63dcdedfbe72c5dc5 -F test/speed1.test 7ac6aecd2ab834de2fb81058944a5092f0368f67 +F test/speed1.test 65baf96b7a03e671220a25dfdac00f22c43220b5 F test/speed1p.explain d841e650a04728b39e6740296b852dccdca9b2cb -F test/speed1p.test 1c932ff428cd7c26f0324a6ac59b16dfb2fd8efa +F test/speed1p.test bc1f3c2cbb1142640f9a68bcc458119dc979ad9c F test/speed2.test 53177056baf6556dcbdcf032bbdfc41c1aa74ded F test/speed3.test e312d7e442a5047d730569fdae2ba99bc94e1a13 F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715 @@ -612,7 +612,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 1dbced29de5f59ba2ebf877edcadf171540374d1 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e -P 78a623bbb17e35bcb902d3ea1d0b963570588d2d -R e1ffe211eae07b8e481d5f2e4eeaee38 +P ec09b551e8279e791070515e1f2413f44dc67ea5 +R f345ec71ab69d5e2a656c297e7e3014c U drh -Z ebb109fd49f39853f30dc97962fbc79b +Z d20474b144bde5d5539e2012e207e0db diff --git a/manifest.uuid b/manifest.uuid index f3c62fc6a8..a5d4bbbdc3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ec09b551e8279e791070515e1f2413f44dc67ea5 \ No newline at end of file +0ce39c21f32958ae53c00dc8bbf8cdd453f2d90e \ No newline at end of file diff --git a/src/malloc.c b/src/malloc.c index f90e627536..c7b2e650f9 100644 --- a/src/malloc.c +++ b/src/malloc.c @@ -12,7 +12,7 @@ ** ** Memory allocation functions used throughout sqlite. ** -** $Id: malloc.c,v 1.30 2008/07/28 19:34:53 drh Exp $ +** $Id: malloc.c,v 1.31 2008/07/29 14:29:07 drh Exp $ */ #include "sqliteInt.h" #include @@ -443,7 +443,7 @@ void sqlite3PageFree(void *p){ mem0.aPageFree[mem0.nPageFree++] = i; sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_USED, -1); sqlite3_mutex_leave(mem0.mutex); -#ifndef NDEBUG +#if !defined(NDEBUG) && 0 /* Assert that a duplicate was not just inserted into aPageFree[]. */ for(i=0; imx ) N = mx; + buf = malloc( (sz+4)*N ); rc = sqlite3_config(SQLITE_CONFIG_SCRATCH, buf, sz, N); } pResult = Tcl_NewObj(); @@ -913,18 +914,19 @@ static int test_config_pagecache( ){ int sz, N, rc; Tcl_Obj *pResult; - static char buf[100000]; + static char *buf = 0; if( objc!=3 ){ Tcl_WrongNumArgs(interp, 1, objv, "SIZE N"); return TCL_ERROR; } if( Tcl_GetIntFromObj(interp, objv[1], &sz) ) return TCL_ERROR; if( Tcl_GetIntFromObj(interp, objv[2], &N) ) return TCL_ERROR; + free(buf); if( sz<0 ){ + buf = 0; rc = sqlite3_config(SQLITE_CONFIG_PAGECACHE, 0, 0, 0); }else{ - int mx = sizeof(buf)/(sz+4); - if( N>mx ) N = mx; + buf = malloc( (sz+4)*N ); rc = sqlite3_config(SQLITE_CONFIG_PAGECACHE, buf, sz, N); } pResult = Tcl_NewObj(); diff --git a/test/speed1.test b/test/speed1.test index ba0d8c1547..5fab54f365 100644 --- a/test/speed1.test +++ b/test/speed1.test @@ -11,12 +11,13 @@ # This file implements regression tests for SQLite library. The # focus of this script is measuring executing speed. # -# $Id: speed1.test,v 1.7 2008/07/28 19:34:54 drh Exp $ +# $Id: speed1.test,v 1.8 2008/07/29 14:29:07 drh Exp $ # sqlite3_shutdown sqlite3_config_scratch 29000 1 sqlite3_config_lookaside 1000 300 +sqlite3_config_pagecache 1024 10000 set testdir [file dirname $argv0] source $testdir/tester.tcl speed_trial_init speed1 diff --git a/test/speed1p.test b/test/speed1p.test index 8ece209dde..eb968d4400 100644 --- a/test/speed1p.test +++ b/test/speed1p.test @@ -13,11 +13,13 @@ # # This is a copy of speed1.test modified to user prepared statements. # -# $Id: speed1p.test,v 1.3 2008/07/24 23:34:07 drh Exp $ +# $Id: speed1p.test,v 1.4 2008/07/29 14:29:07 drh Exp $ # sqlite3_shutdown sqlite3_config_scratch 29000 1 +sqlite3_config_lookaside 2048 300 +sqlite3_config_pagecache 1024 11000 set testdir [file dirname $argv0] source $testdir/tester.tcl speed_trial_init speed1 @@ -64,7 +66,7 @@ proc number_name {n} { do_test speed1p-1.0 { execsql { PRAGMA page_size=1024; - PRAGMA cache_size=8192; + PRAGMA cache_size=500; PRAGMA locking_mode=EXCLUSIVE; CREATE TABLE t1(a INTEGER, b INTEGER, c TEXT); CREATE TABLE t2(a INTEGER, b INTEGER, c TEXT);