SQLite

Check-in [9283478e69]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:After running speed1.test and speed1p.test, reset the size of the lookaside buffer. Otherwise, subsequent runs of malloc5.test may report an error. Changes to test code only. (CVS 5824)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9283478e69d84aa99b2d4636587c8c0b34e7c4da
User & Date: danielk1977 2008-10-15 11:43:55.000
Context
2008-10-15
11:59
Version 3.6.4 (CVS 5825) (check-in: cd73cffab3 user: drh tags: trunk, release)
11:43
After running speed1.test and speed1p.test, reset the size of the lookaside buffer. Otherwise, subsequent runs of malloc5.test may report an error. Changes to test code only. (CVS 5824) (check-in: 9283478e69 user: danielk1977 tags: trunk)
2008-10-14
19:21
Disable the page-cache at the end of pcache2.test. (CVS 5823) (check-in: 3d2d05b628 user: danielk1977 tags: trunk)
Changes
Unified Diff Show Whitespace Changes Patch
Changes to src/test_malloc.c.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
**    May you share freely, never taking more than you give.
**
*************************************************************************
**
** This file contains code used to implement test interfaces to the
** memory allocation subsystem.
**
** $Id: test_malloc.c,v 1.48 2008/10/10 17:41:29 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>








|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
**    May you share freely, never taking more than you give.
**
*************************************************************************
**
** This file contains code used to implement test interfaces to the
** memory allocation subsystem.
**
** $Id: test_malloc.c,v 1.49 2008/10/15 11:43:55 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#include <stdlib.h>
#include <string.h>
#include <assert.h>

997
998
999
1000
1001
1002
1003

1004
1005
1006
1007
1008
1009







1010
1011
1012
1013
1014
1015
1016
1017
1018
  void * clientData,
  Tcl_Interp *interp,
  int objc,
  Tcl_Obj *CONST objv[]
){
  int rc;
  int sz, cnt;

  if( objc!=3 ){
    Tcl_WrongNumArgs(interp, 1, objv, "SIZE COUNT");
    return TCL_ERROR;
  }
  if( Tcl_GetIntFromObj(interp, objv[1], &sz) ) return TCL_ERROR;
  if( Tcl_GetIntFromObj(interp, objv[2], &cnt) ) return TCL_ERROR;







  rc = sqlite3_config(SQLITE_CONFIG_LOOKASIDE, sz, cnt);
  Tcl_SetObjResult(interp, Tcl_NewIntObj(rc));
  return TCL_OK;
}


/*
** Usage:    sqlite3_db_config_lookaside  CONNECTION  BUFID  SIZE  COUNT
**







>






>
>
>
>
>
>
>

|







997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
  void * clientData,
  Tcl_Interp *interp,
  int objc,
  Tcl_Obj *CONST objv[]
){
  int rc;
  int sz, cnt;
  Tcl_Obj *pRet;
  if( objc!=3 ){
    Tcl_WrongNumArgs(interp, 1, objv, "SIZE COUNT");
    return TCL_ERROR;
  }
  if( Tcl_GetIntFromObj(interp, objv[1], &sz) ) return TCL_ERROR;
  if( Tcl_GetIntFromObj(interp, objv[2], &cnt) ) return TCL_ERROR;
  pRet = Tcl_NewObj();
  Tcl_ListObjAppendElement(
      interp, pRet, Tcl_NewIntObj(sqlite3GlobalConfig.szLookaside)
  );
  Tcl_ListObjAppendElement(
      interp, pRet, Tcl_NewIntObj(sqlite3GlobalConfig.nLookaside)
  );
  rc = sqlite3_config(SQLITE_CONFIG_LOOKASIDE, sz, cnt);
  Tcl_SetObjResult(interp, pRet);
  return TCL_OK;
}


/*
** Usage:    sqlite3_db_config_lookaside  CONNECTION  BUFID  SIZE  COUNT
**
Changes to test/speed1.test.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 2006 November 23
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#*************************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is measuring executing speed.
#
# $Id: speed1.test,v 1.9 2008/07/30 13:15:46 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

# Set a uniform random seed
expr srand(0)













|




|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 2006 November 23
#
# The author disclaims copyright to this source code.  In place of
# a legal notice, here is a blessing:
#
#    May you do good and not evil.
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#*************************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is measuring executing speed.
#
# $Id: speed1.test,v 1.10 2008/10/15 11:43:55 danielk1977 Exp $
#

sqlite3_shutdown
#sqlite3_config_scratch 29000 1
set old_lookaside [sqlite3_config_lookaside 1000 300]
#sqlite3_config_pagecache 1024 10000
set testdir [file dirname $argv0]
source $testdir/tester.tcl
speed_trial_init speed1

# Set a uniform random seed
expr srand(0)
286
287
288
289
290
291
292



293
    (SELECT rowid FROM t1 ORDER BY random() LIMIT 20000)
}
do_test speed1-1.2 {
  db one {SELECT count(*) FROM t1}
} 10000
speed_trial_summary speed1




finish_test







>
>
>

286
287
288
289
290
291
292
293
294
295
296
    (SELECT rowid FROM t1 ORDER BY random() LIMIT 20000)
}
do_test speed1-1.2 {
  db one {SELECT count(*) FROM t1}
} 10000
speed_trial_summary speed1

db close
sqlite3_shutdown
eval sqlite3_config_lookaside $old_lookaside
finish_test
Changes to test/speed1p.test.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
#*************************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is measuring executing speed.  
#
# This is a copy of speed1.test modified to user prepared statements.
#
# $Id: speed1p.test,v 1.5 2008/07/30 13:15:46 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

# Set a uniform random seed
expr srand(0)







|




|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#
#*************************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this script is measuring executing speed.  
#
# This is a copy of speed1.test modified to user prepared statements.
#
# $Id: speed1p.test,v 1.6 2008/10/15 11:43:55 danielk1977 Exp $
#

sqlite3_shutdown
#sqlite3_config_scratch 29000 1
set old_lookaside [sqlite3_config_lookaside 2048 300]
#sqlite3_config_pagecache 1024 11000
set testdir [file dirname $argv0]
source $testdir/tester.tcl
speed_trial_init speed1

# Set a uniform random seed
expr srand(0)
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341



342
speed_trial speed1p-random-del1 20000 row {
  DELETE FROM t1 WHERE rowid IN
    (SELECT rowid FROM t1 ORDER BY random() LIMIT 20000)
}
do_test speed1p-1.1 {
  db one {SELECT count(*) FROM t1}
} 30000

    
# Delete 20000 more rows at random from the table.
#
speed_trial speed1p-random-del2 20000 row {
  DELETE FROM t1 WHERE rowid IN
    (SELECT rowid FROM t1 ORDER BY random() LIMIT 20000)
}
do_test speed1p-1.2 {
  db one {SELECT count(*) FROM t1}
} 10000
speed_trial_summary speed1




finish_test







<












>
>
>

322
323
324
325
326
327
328

329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
speed_trial speed1p-random-del1 20000 row {
  DELETE FROM t1 WHERE rowid IN
    (SELECT rowid FROM t1 ORDER BY random() LIMIT 20000)
}
do_test speed1p-1.1 {
  db one {SELECT count(*) FROM t1}
} 30000

    
# Delete 20000 more rows at random from the table.
#
speed_trial speed1p-random-del2 20000 row {
  DELETE FROM t1 WHERE rowid IN
    (SELECT rowid FROM t1 ORDER BY random() LIMIT 20000)
}
do_test speed1p-1.2 {
  db one {SELECT count(*) FROM t1}
} 10000
speed_trial_summary speed1

db close
sqlite3_shutdown
eval sqlite3_config_lookaside $old_lookaside
finish_test