Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: third_party/sqlite/src/test/speed1p.test

Issue 901033002: Import SQLite 3.8.7.4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Chromium changes to support SQLite 3.8.7.4. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # 2008 March 21 1 # 2008 March 21
2 # 2 #
3 # The author disclaims copyright to this source code. In place of 3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing: 4 # a legal notice, here is a blessing:
5 # 5 #
6 # May you do good and not evil. 6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others. 7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give. 8 # May you share freely, never taking more than you give.
9 # 9 #
10 #************************************************************************* 10 #*************************************************************************
11 # This file implements regression tests for SQLite library. The 11 # This file implements regression tests for SQLite library. The
12 # focus of this script is measuring executing speed. 12 # focus of this script is measuring executing speed.
13 # 13 #
14 # This is a copy of speed1.test modified to user prepared statements. 14 # This is a copy of speed1.test modified to user prepared statements.
15 # 15 #
16 # $Id: speed1p.test,v 1.7 2009/04/09 01:23:49 drh Exp $ 16 # $Id: speed1p.test,v 1.7 2009/04/09 01:23:49 drh Exp $
17 # 17 #
18 18
19 sqlite3_shutdown 19 sqlite3_shutdown
20 #sqlite3_config_scratch 29000 1 20 #sqlite3_config_scratch 29000 1
21 set old_lookaside [sqlite3_config_lookaside 2048 300] 21 set old_lookaside [sqlite3_config_lookaside 2048 300]
22 #sqlite3_config_pagecache 1024 11000 22 #sqlite3_config_pagecache 1024 11000
23 set testdir [file dirname $argv0] 23 set testdir [file dirname $argv0]
24 source $testdir/tester.tcl 24 source $testdir/tester.tcl
25 speed_trial_init speed1 25 speed_trial_init speed1
26 26
27 sqlite3_memdebug_vfs_oom_test 0
28
27 # Set a uniform random seed 29 # Set a uniform random seed
28 expr srand(0) 30 expr srand(0)
29 31
30 # The number_name procedure below converts its argment (an integer) 32 # The number_name procedure below converts its argment (an integer)
31 # into a string which is the English-language name for that number. 33 # into a string which is the English-language name for that number.
32 # 34 #
33 # Example: 35 # Example:
34 # 36 #
35 # puts [number_name 123] -> "one hundred twenty three" 37 # puts [number_name 123] -> "one hundred twenty three"
36 # 38 #
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 CREATE TABLE t1(a INTEGER, b INTEGER, c TEXT); 73 CREATE TABLE t1(a INTEGER, b INTEGER, c TEXT);
72 CREATE TABLE t2(a INTEGER, b INTEGER, c TEXT); 74 CREATE TABLE t2(a INTEGER, b INTEGER, c TEXT);
73 CREATE INDEX i2a ON t2(a); 75 CREATE INDEX i2a ON t2(a);
74 CREATE INDEX i2b ON t2(b); 76 CREATE INDEX i2b ON t2(b);
75 } 77 }
76 execsql { 78 execsql {
77 SELECT name FROM sqlite_master ORDER BY 1; 79 SELECT name FROM sqlite_master ORDER BY 1;
78 } 80 }
79 } {i2a i2b t1 t2} 81 } {i2a i2b t1 t2}
80 82
81
82 # 50000 INSERTs on an unindexed table 83 # 50000 INSERTs on an unindexed table
83 # 84 #
84 set list {} 85 set list {}
85 for {set i 1} {$i<=50000} {incr i} { 86 for {set i 1} {$i<=50000} {incr i} {
86 set r [expr {int(rand()*500000)}] 87 set r [expr {int(rand()*500000)}]
87 set x [number_name $r] 88 set x [number_name $r]
88 lappend list $i $r $x 89 lappend list $i $r $x
89 } 90 }
90 set script { 91 set script {
91 foreach {i r x} $::list { 92 foreach {i r x} $::list {
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 db one {SELECT count(*) FROM t1} 338 db one {SELECT count(*) FROM t1}
338 } 10000 339 } 10000
339 speed_trial_summary speed1 340 speed_trial_summary speed1
340 341
341 db close 342 db close
342 sqlite3_shutdown 343 sqlite3_shutdown
343 eval sqlite3_config_lookaside $old_lookaside 344 eval sqlite3_config_lookaside $old_lookaside
344 sqlite3_initialize 345 sqlite3_initialize
345 autoinstall_test_functions 346 autoinstall_test_functions
346 finish_test 347 finish_test
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698