Open database with TDB_NOSYNC to speed it up a little.
authorRusty Russell <rusty@rustcorp.com.au>
Thu, 16 Jul 2009 01:03:52 +0000 (10:33 +0930)
committerRusty Russell <rusty@rustcorp.com.au>
Thu, 16 Jul 2009 01:03:52 +0000 (10:33 +0930)
ccan/tdb/tools/replay_trace.c

index 124b7458dfa7688b0f3dbd9d7df976a8870f5ed8..8fc0ce52a63379cdf325ee4fd2ced797afb8edb0 100644 (file)
@@ -1448,9 +1448,8 @@ int main(int argc, char *argv[])
        /* Don't fork for single arg case: simple debugging. */
        if (argc == 3) {
                struct tdb_context *tdb;
-               tdb = tdb_open_ex(argv[1], hashsize[0], tdb_flags[0],
-                                 open_flags[0], 0600,
-                                 NULL, hash_key);
+               tdb = tdb_open_ex(argv[1], hashsize[0], tdb_flags[0]|TDB_NOSYNC,
+                                 open_flags[0], 0600, NULL, hash_key);
                printf("Single threaded run...");
                fflush(stdout);
 
@@ -1472,9 +1471,9 @@ int main(int argc, char *argv[])
                        err(1, "fork failed");
                case 0:
                        close(fds[1]);
-                       tdb = tdb_open_ex(argv[1], hashsize[i], tdb_flags[i],
-                                         open_flags[i], 0600,
-                                         NULL, hash_key);
+                       tdb = tdb_open_ex(argv[1], hashsize[i],
+                                         tdb_flags[i]|TDB_NOSYNC,
+                                         open_flags[i], 0600, NULL, hash_key);
                        if (!tdb)
                                err(1, "Opening tdb %s", argv[1]);