System.Data.SQLite
Check-in [16705da626]
Not logged in

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

Overview
Comment:Enhance the SQLiteDataReader performance test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 16705da6269b49befe3b4370903b5eed057ad740
User & Date: mistachkin 2014-07-18 22:42:59
Context
2014-07-18
23:35
Further enhancements to the SQLiteDataReader performance tests. check-in: 36cfd553e3 user: mistachkin tags: trunk
22:42
Enhance the SQLiteDataReader performance test. check-in: 16705da626 user: mistachkin tags: trunk
22:04
Add initial performance tests for the SQLiteDataReader class. check-in: d3be3b1abe user: mistachkin tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to Tests/speed.eagle.

66
67
68
69
70
71
72
73
74
75
76
77
78
79


80
81
82




83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101





















































102
103
104
105
106
107
108

  sql execute $db "INSERT INTO t3 (y) VALUES(NULL);"
  sql execute $db "INSERT INTO t3 (y) VALUES('1');"
  sql execute $db "INSERT INTO t3 (y) VALUES('1.1');"

  sql execute $db [appendArgs \
      "INSERT INTO t3 (y) VALUES('" [string repeat \
      [format %c [expr {int(rand() * 0x100)}]] 1048576] "');"]

  sql execute $db "INSERT INTO t4 (z) VALUES(NULL);"
  sql execute $db "INSERT INTO t4 (z) VALUES(X'01');"
  sql execute $db "INSERT INTO t4 (z) VALUES(X'0123456789');"
  sql execute $db "INSERT INTO t4 (z) VALUES(randomblob(1048576));"
} -body {


  foreach sql [list \
      {SELECT w FROM t1;} \
      {SELECT x FROM t2;} \




      {SELECT CASE length(y) = 1048576
         WHEN 1 THEN length(y) ELSE y END FROM t3;} \
      {SELECT CASE length(z) = 1048576
         WHEN 1 THEN length(z) ELSE z END FROM t4;}] {
    tputs $test_channel [appendArgs \
        "---- executed query \"" \
        [string map [list "\n         " " "] $sql] "\" in " [time {
          lappend result [sql execute -execute reader -format list $db $sql]
        }] \n]
  }

  set result
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain result sql db fileName
} -time true -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {{-9223372036854775808 0 9223372036854775807}\
{-Infinity 0 Infinity} {1 1.1 1048576} {1 {1 35 69 103 137} 1048576}}}






















































###############################################################################

#
# NOTE: Report after test.
#
checkForSQLiteDirectories $test_channel







|






>
>

<
<
>
>
>
>

|

|


|








|



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82


83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165

  sql execute $db "INSERT INTO t3 (y) VALUES(NULL);"
  sql execute $db "INSERT INTO t3 (y) VALUES('1');"
  sql execute $db "INSERT INTO t3 (y) VALUES('1.1');"

  sql execute $db [appendArgs \
      "INSERT INTO t3 (y) VALUES('" [string repeat \
      [format %c [expr {int(rand() * 0x80)}]] 1048576] "');"]

  sql execute $db "INSERT INTO t4 (z) VALUES(NULL);"
  sql execute $db "INSERT INTO t4 (z) VALUES(X'01');"
  sql execute $db "INSERT INTO t4 (z) VALUES(X'0123456789');"
  sql execute $db "INSERT INTO t4 (z) VALUES(randomblob(1048576));"
} -body {
  set result [list]

  foreach sql [list \


      {SELECT CASE length(w) = 1048576
              WHEN 1 THEN length(w) ELSE w END FROM t1;} \
      {SELECT CASE length(x) = 1048576
              WHEN 1 THEN length(x) ELSE x END FROM t2;} \
      {SELECT CASE length(y) = 1048576
              WHEN 1 THEN length(y) ELSE y END FROM t3;} \
      {SELECT CASE length(z) = 1048576
              WHEN 1 THEN length(z) ELSE z END FROM t4;}] {
    tputs $test_channel [appendArgs \
        "---- executed query \"" \
        [string map [list "\n              " " "] $sql] "\" in " [time {
          lappend result [sql execute -execute reader -format list $db $sql]
        }] \n]
  }

  set result
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain sql table column result db fileName
} -time true -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {{-9223372036854775808 0 9223372036854775807}\
{-Infinity 0 Infinity} {1 1.1 1048576} {1 {1 35 69 103 137} 1048576}}}

###############################################################################

runTest {test speed-1.2 {SQLiteDataReader speed testing} -setup {
  setupDb [set fileName [appendArgs speed-1.2- [pid] .db]]

  sql execute $db "CREATE TABLE t1(w INTEGER);"
  sql execute $db "CREATE TABLE t2(x REAL);"
  sql execute $db "CREATE TABLE t3(y TEXT);"
  sql execute $db "CREATE TABLE t4(z BLOB);"

  sql execute $db "INSERT INTO t1 (w) VALUES(NULL);"
  sql execute $db "INSERT INTO t1 (w) VALUES(-9223372036854775808);"
  sql execute $db "INSERT INTO t1 (w) VALUES(0);"
  sql execute $db "INSERT INTO t1 (w) VALUES(9223372036854775807);"

  sql execute $db "INSERT INTO t2 (x) VALUES(NULL);"
  sql execute $db "INSERT INTO t2 (x) VALUES(-1.7976931348623157e+308);"
  sql execute $db "INSERT INTO t2 (x) VALUES(0.0);"
  sql execute $db "INSERT INTO t2 (x) VALUES(1.7976931348623157e+308);"

  sql execute $db "INSERT INTO t3 (y) VALUES(NULL);"
  sql execute $db "INSERT INTO t3 (y) VALUES('1');"
  sql execute $db "INSERT INTO t3 (y) VALUES('1.1');"

  sql execute $db [appendArgs \
      "INSERT INTO t3 (y) VALUES('" [string repeat \
      [format %c [expr {int(rand() * 0x80)}]] 1048576] "');"]

  sql execute $db "INSERT INTO t4 (z) VALUES(NULL);"
  sql execute $db "INSERT INTO t4 (z) VALUES(X'01');"
  sql execute $db "INSERT INTO t4 (z) VALUES(X'0123456789');"
  sql execute $db "INSERT INTO t4 (z) VALUES(randomblob(1048576));"
} -body {
  set result [list]

  foreach {column table} [list w t1 x t2 y t3 z t4] {
    set sql [appendArgs "SELECT " $column " FROM " $table \;]

    tputs $test_channel [appendArgs \
        "---- executed query \"" $sql "\" in " [time {
          lappend result [llength [sql execute \
              -execute reader -format list $db $sql]]
        }] \n]
  }

  set result
} -cleanup {
  cleanupDb $fileName

  unset -nocomplain sql table column result db fileName
} -time true -constraints {eagle monoBug28 command.sql compile.DATA SQLite\
System.Data.SQLite} -result {3 3 3 3}}

###############################################################################

#
# NOTE: Report after test.
#
checkForSQLiteDirectories $test_channel