/ Check-in [69a17336]
Login

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

Overview
Comment:Add a case to speedtest1.c that demonstrates the need to factor OP_Column operators out of inner loops.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 69a17336fdf4ae891e815914be8942f7222230c2
User & Date: drh 2013-12-21 00:04:37
Context
2013-12-21
15:46
Fix the ".echo on" dot-command of the shell so that it echos comments in addition to SQL statements and dot-commands. Add the --explain option to speedtest1 so that the output can be piped into the command-line shell to show nicely-formated VDBE code for the entire test. check-in: 96397263 user: drh tags: trunk
00:04
Add a case to speedtest1.c that demonstrates the need to factor OP_Column operators out of inner loops. check-in: 69a17336 user: drh tags: trunk
2013-12-20
18:57
Fix compiler harmless warnings in tclsqlite.c that appeared with GCC 4.8.x. check-in: d93ae683 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/speedtest1.c.

   373    373   static void randomFunc(
   374    374     sqlite3_context *context,
   375    375     int NotUsed,
   376    376     sqlite3_value **NotUsed2
   377    377   ){
   378    378     sqlite3_result_int64(context, (sqlite3_int64)speedtest1_random());
   379    379   }
          380  +
          381  +/* Estimate the square root of an integer */
          382  +static int est_square_root(int x){
          383  +  int y0 = x/2;
          384  +  int y1;
          385  +  int n;
          386  +  for(n=0; y0>0 && n<10; n++){
          387  +    y1 = (y0 + x/y0)/2;
          388  +    if( y1==y0 ) break;
          389  +    y0 = y1;
          390  +  }
          391  +  return y0;
          392  +}
   380    393   
   381    394   /*
   382    395   ** The main and default testset
   383    396   */
   384    397   void testset_main(void){
   385    398     int i;                        /* Loop counter */
   386    399     int n;                        /* iteration count */
................................................................................
   688    701       sqlite3_bind_int(g.pStmt, 1, x1);
   689    702       sqlite3_bind_int(g.pStmt, 2, x2);
   690    703       speedtest1_run();
   691    704     }
   692    705     speedtest1_exec("COMMIT");
   693    706     speedtest1_end_test();
   694    707   
   695         -
          708  +  speedtest1_begin_test(320, "subquery in result set", n);
          709  +  speedtest1_prepare(
          710  +    "SELECT sum(a), max(c),\n"
          711  +    "       avg((SELECT a FROM t2 WHERE 5+t2.b=t1.b) AND rowid<?1), max(c)\n"
          712  +    " FROM t1 WHERE rowid<?1;"
          713  +  );
          714  +  sqlite3_bind_int(g.pStmt, 1, est_square_root(g.szTest)*50);
          715  +  speedtest1_run();
          716  +  speedtest1_end_test();
   696    717   
   697    718     speedtest1_begin_test(980, "PRAGMA integrity_check");
   698    719     speedtest1_exec("PRAGMA integrity_check");
   699    720     speedtest1_end_test();
   700    721   
   701    722   
   702    723     speedtest1_begin_test(990, "ANALYZE");