diff options
-rw-r--r-- | store/test/storagebenchmark.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/store/test/storagebenchmark.cpp b/store/test/storagebenchmark.cpp index 6f9f18b..3be90e9 100644 --- a/store/test/storagebenchmark.cpp +++ b/store/test/storagebenchmark.cpp | |||
@@ -94,7 +94,9 @@ private Q_SLOTS: | |||
94 | for (int i = 0; i < count; i++) { | 94 | for (int i = 0; i < count; i++) { |
95 | if (db) { | 95 | if (db) { |
96 | if (i % 10000 == 0) { | 96 | if (i % 10000 == 0) { |
97 | db->commitTransaction(); | 97 | if (i > 0) { |
98 | db->commitTransaction(); | ||
99 | } | ||
98 | db->startTransaction(); | 100 | db->startTransaction(); |
99 | } | 101 | } |
100 | 102 | ||
@@ -110,10 +112,9 @@ private Q_SLOTS: | |||
110 | myfile.close(); | 112 | myfile.close(); |
111 | } | 113 | } |
112 | } | 114 | } |
113 | const int writeDuration = time.elapsed(); | 115 | const int writeDuration = time.restart(); |
114 | qDebug() << "Writing took[ms]: " << writeDuration; | 116 | qDebug() << "Writing took[ms]: " << writeDuration; |
115 | 117 | ||
116 | time.start(); | ||
117 | { | 118 | { |
118 | for (int i = 0; i < count; i++) { | 119 | for (int i = 0; i < count; i++) { |
119 | if (db) { | 120 | if (db) { |
@@ -121,13 +122,15 @@ private Q_SLOTS: | |||
121 | } | 122 | } |
122 | } | 123 | } |
123 | } | 124 | } |
124 | const int readDuration = time.elapsed(); | 125 | const int readDuration = time.restart(); |
125 | 126 | ||
126 | if (useDb) { | 127 | if (db) { |
127 | qDebug() << "Reading took[ms]: " << readDuration; | 128 | qDebug() << "Reading took[ms]: " << readDuration; |
128 | } else { | 129 | } else { |
129 | qDebug() << "File reading is not implemented."; | 130 | qDebug() << "File reading is not implemented."; |
130 | } | 131 | } |
132 | |||
133 | delete db; | ||
131 | } | 134 | } |
132 | 135 | ||
133 | void testBufferCreation() | 136 | void testBufferCreation() |