1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Improvements to the output of the speed tests. (CVS 3785)

FossilOrigin-Name: 1a4d8024b06488f17831b5d3d47e41c5f1134800
This commit is contained in:
drh
2007-03-31 22:34:16 +00:00
parent e1521f4c05
commit dd92431a03
5 changed files with 29 additions and 16 deletions

View File

@ -11,7 +11,7 @@
# This file implements some common TCL routines used for regression
# testing the SQLite library
#
# $Id: tester.tcl,v 1.76 2007/03/25 19:08:47 drh Exp $
# $Id: tester.tcl,v 1.77 2007/03/31 22:34:16 drh Exp $
# Make sure tclsqlite3 was compiled correctly. Abort now with an
# error message if not.
@ -125,15 +125,23 @@ proc do_test {name cmd expected} {
# Return the number of microseconds per statement.
#
proc speed_trial {name numstmt units sql} {
puts -nonewline [format {%-20.20s } $name...]
puts -nonewline [format {%-21.21s } $name...]
flush stdout
set speed [time {sqlite3_exec_nr db $sql}]
set tm [lindex $speed 0]
set per [expr {$tm/(1.0*$numstmt)}]
set rate [expr {1000000.0*$numstmt/$tm}]
set u1 us/$units
set u2 $units/s
puts [format {%20.3f %-7s %20.5f %s} $per $u1 $rate $u2]
puts [format {%12d uS %20.5f %s} $tm $rate $u2]
global total_time
set total_time [expr {$total_time+$tm}]
}
proc speed_trial_init {name} {
global total_time
set total_time 0
}
proc speed_trial_summary {name} {
global total_time
puts [format {%-21.21s %12d uS TOTAL} $name $total_time]
}
# The procedure uses the special "sqlite_malloc_stat" command