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

Side by Side Diff: third_party/sqlite/src/tool/speedtest8inst1.c

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « third_party/sqlite/src/tool/speedtest16.c ('k') | third_party/sqlite/src/tool/sqldiff.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ** Performance test for SQLite. 2 ** Performance test for SQLite.
3 ** 3 **
4 ** This program reads ASCII text from a file named on the command-line 4 ** This program reads ASCII text from a file named on the command-line
5 ** and submits that text to SQLite for evaluation. A new database 5 ** and submits that text to SQLite for evaluation. A new database
6 ** is created at the beginning of the program. All statements are 6 ** is created at the beginning of the program. All statements are
7 ** timed using the high-resolution timer built into Intel-class processors. 7 ** timed using the high-resolution timer built into Intel-class processors.
8 ** 8 **
9 ** To compile this program, first compile the SQLite library separately 9 ** To compile this program, first compile the SQLite library separately
10 ** will full optimizations. For example: 10 ** will full optimizations. For example:
(...skipping 11 matching lines...) Expand all
22 ** ./a.out test.db test.sql 22 ** ./a.out test.db test.sql
23 */ 23 */
24 #include <stdio.h> 24 #include <stdio.h>
25 #include <string.h> 25 #include <string.h>
26 #include <stdlib.h> 26 #include <stdlib.h>
27 #include <ctype.h> 27 #include <ctype.h>
28 #include <unistd.h> 28 #include <unistd.h>
29 #include <stdarg.h> 29 #include <stdarg.h>
30 #include "sqlite3.h" 30 #include "sqlite3.h"
31 31
32 #define ISSPACE(X) isspace((unsigned char)(X))
33
32 #include "test_osinst.c" 34 #include "test_osinst.c"
33 35
34 /* 36 /*
35 ** Prepare and run a single statement of SQL. 37 ** Prepare and run a single statement of SQL.
36 */ 38 */
37 static void prepareAndRun(sqlite3_vfs *pInstVfs, sqlite3 *db, const char *zSql){ 39 static void prepareAndRun(sqlite3_vfs *pInstVfs, sqlite3 *db, const char *zSql){
38 sqlite3_stmt *pStmt; 40 sqlite3_stmt *pStmt;
39 const char *stmtTail; 41 const char *stmtTail;
40 int rc; 42 int rc;
41 char zMessage[1024]; 43 char zMessage[1024];
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 192
191 for(i=j=0; j<nSql; j++){ 193 for(i=j=0; j<nSql; j++){
192 if( zSql[j]==';' ){ 194 if( zSql[j]==';' ){
193 int isComplete; 195 int isComplete;
194 char c = zSql[j+1]; 196 char c = zSql[j+1];
195 zSql[j+1] = 0; 197 zSql[j+1] = 0;
196 isComplete = sqlite3_complete(&zSql[i]); 198 isComplete = sqlite3_complete(&zSql[i]);
197 zSql[j+1] = c; 199 zSql[j+1] = c;
198 if( isComplete ){ 200 if( isComplete ){
199 zSql[j] = 0; 201 zSql[j] = 0;
200 while( i<j && isspace(zSql[i]) ){ i++; } 202 while( i<j && ISSPACE(zSql[i]) ){ i++; }
201 if( i<j ){ 203 if( i<j ){
202 prepareAndRun(pInstVfs, db, &zSql[i]); 204 prepareAndRun(pInstVfs, db, &zSql[i]);
203 } 205 }
204 zSql[j] = ';'; 206 zSql[j] = ';';
205 i = j+1; 207 i = j+1;
206 } 208 }
207 } 209 }
208 } 210 }
209 211
210 sqlite3_instvfs_destroy(pInstVfs); 212 sqlite3_instvfs_destroy(pInstVfs);
211 return 0; 213 return 0;
212 214
213 usage: 215 usage:
214 fprintf(stderr, zUsageMsg, argv[0]); 216 fprintf(stderr, zUsageMsg, argv[0]);
215 return -3; 217 return -3;
216 } 218 }
OLDNEW
« no previous file with comments | « third_party/sqlite/src/tool/speedtest16.c ('k') | third_party/sqlite/src/tool/sqldiff.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698