/ Check-in [56febbeb]
Login

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

Overview
Comment:Add the Mandelbrot Set testcase to the "cte" testset of speedtest1.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 56febbeb575a298ae8839b3a59711150ceb9999d
User & Date: drh 2014-02-09 00:52:53
Context
2014-02-09
18:02
Use the WITH clause to help resolve names for SELECT statements on the left of a compound query. Proposed fix for ticket [31a19d11b97088296a]. check-in: 67bfd59d user: drh tags: trunk
00:52
Add the Mandelbrot Set testcase to the "cte" testset of speedtest1. check-in: 56febbeb user: drh tags: trunk
00:18
Add a new "testset" to the speedtest1 program: The sudoku solver. check-in: 4677ef2f user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/speedtest1.c.

   773    773       "4..8.3..1"
   774    774       "....2...6"
   775    775       ".6....28."
   776    776       "...419..5"
   777    777       "....8..79",
   778    778     };
   779    779     const char *zPuz;
          780  +  double rSpacing;
   780    781   
   781    782     if( g.szTest<25 ){
   782    783       zPuz = azPuzzle[0];
   783    784     }else if( g.szTest<70 ){
   784    785       zPuz = azPuzzle[1];
   785    786     }else{
   786    787       zPuz = azPuzzle[2];
................................................................................
   843    844       "         )\n"
   844    845       "  )\n"
   845    846       "SELECT s FROM x WHERE ind=0;"
   846    847     );
   847    848     sqlite3_bind_text(g.pStmt, 1, zPuz, -1, SQLITE_STATIC);
   848    849     speedtest1_run();
   849    850     speedtest1_end_test();
          851  +
          852  +  rSpacing = 5.0/g.szTest;
          853  +  speedtest1_begin_test(300, "Mandelbrot Set with spacing=%f", rSpacing);
          854  +  speedtest1_prepare(
          855  +   "WITH RECURSIVE \n"
          856  +   "  xaxis(x) AS (VALUES(-2.0) UNION ALL SELECT x+?1 FROM xaxis WHERE x<1.2),\n"
          857  +   "  yaxis(y) AS (VALUES(-1.0) UNION ALL SELECT y+?2 FROM yaxis WHERE y<1.0),\n"
          858  +   "  m(iter, cx, cy, x, y) AS (\n"
          859  +   "    SELECT 0, x, y, 0.0, 0.0 FROM xaxis, yaxis\n"
          860  +   "    UNION ALL\n"
          861  +   "    SELECT iter+1, cx, cy, x*x-y*y + cx, 2.0*x*y + cy FROM m \n"
          862  +   "     WHERE (x*x + y*y) < 4.0 AND iter<28\n"
          863  +   "  ),\n"
          864  +   "  m2(iter, cx, cy) AS (\n"
          865  +   "    SELECT max(iter), cx, cy FROM m GROUP BY cx, cy\n"
          866  +   "  ),\n"
          867  +   "  a(t) AS (\n"
          868  +   "    SELECT group_concat( substr(' .+*#', 1+min(iter/7,4), 1), '') \n"
          869  +   "    FROM m2 GROUP BY cy\n"
          870  +   "  )\n"
          871  +   "SELECT group_concat(rtrim(t),x'0a') FROM a;"
          872  +  );
          873  +  sqlite3_bind_double(g.pStmt, 1, rSpacing*.05);
          874  +  sqlite3_bind_double(g.pStmt, 2, rSpacing);
          875  +  speedtest1_run();
          876  +  speedtest1_end_test();
          877  +
   850    878   }
   851    879   
   852    880   /*
   853    881   ** A testset used for debugging speedtest1 itself.
   854    882   */
   855    883   void testset_debug1(void){
   856    884     unsigned i, n;