作者: 韩晨旭 10225101440 李畅 10225102463
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

461 lines
21 KiB

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>LevelDB Benchmarks</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  6. <style>
  7. body {
  8. font-family:Helvetica,sans-serif;
  9. padding:20px;
  10. }
  11. h2 {
  12. padding-top:30px;
  13. }
  14. table.bn {
  15. width:800px;
  16. border-collapse:collapse;
  17. border:0;
  18. padding:0;
  19. }
  20. table.bnbase {
  21. width:650px;
  22. }
  23. table.bn td {
  24. padding:2px 0;
  25. }
  26. table.bn td.c1 {
  27. font-weight:bold;
  28. width:150px;
  29. }
  30. table.bn td.c1 div.e {
  31. float:right;
  32. font-weight:normal;
  33. }
  34. table.bn td.c2 {
  35. width:150px;
  36. text-align:right;
  37. padding:2px;
  38. }
  39. table.bn td.c3 {
  40. width:350px;
  41. }
  42. table.bn td.c4 {
  43. width:150px;
  44. font-size:small;
  45. padding-left:4px;
  46. }
  47. /* chart bars */
  48. div.bldb {
  49. background-color:#0255df;
  50. }
  51. div.bkct {
  52. background-color:#df5555;
  53. }
  54. div.bsql {
  55. background-color:#aadf55;
  56. }
  57. .code {
  58. font-family:monospace;
  59. font-size:large;
  60. }
  61. .todo {
  62. color: red;
  63. }
  64. </style>
  65. </head>
  66. <body>
  67. <h1>LevelDB Benchmarks</h1>
  68. <p>Google, July 2011</p>
  69. <hr>
  70. <p>In order to test LevelDB's performance, we benchmark it against other well-established database implementations. We compare LevelDB (revision 39) against <a href="http://www.sqlite.org/">SQLite3</a> (version 3.7.6.3) and <a href="http://fallabs.com/kyotocabinet/spex.html">Kyoto Cabinet's</a> (version 1.2.67) TreeDB (a B+Tree based key-value store). We would like to acknowledge Scott Hess and Mikio Hirabayashi for their suggestions and contributions to the SQLite3 and Kyoto Cabinet benchmarks, respectively.</p>
  71. <p>Benchmarks were all performed on a six-core Intel(R) Xeon(R) CPU X5650 @ 2.67GHz, with 12288 KB of total L3 cache and 12 GB of DDR3 RAM at 1333 MHz. (Note that LevelDB uses at most two CPUs since the benchmarks are single threaded: one to run the benchmark, and one for background compactions.) We ran the benchmarks on two machines (with identical processors), one with an Ext3 file system and one with an Ext4 file system. The machine with the Ext3 file system has a SATA Hitachi HDS721050CLA362 hard drive. The machine with the Ext4 file system has a SATA Samsung HD502HJ hard drive. Both hard drives spin at 7200 RPM. The numbers reported below are the median of three measurements.</p>
  72. <h4>Benchmark Source Code</h4>
  73. <p>We wrote benchmark tools for SQLite and Kyoto TreeDB based on LevelDB's <span class="code">db_bench</span>. The code for each of the benchmarks resides here:</p>
  74. <ul>
  75. <li> <b>LevelDB:</b> <a href="http://code.google.com/p/leveldb/source/browse/trunk/db/db_bench.cc">db/db_bench.cc</a>.</li>
  76. <li> <b>SQLite:</b> <a href="http://code.google.com/p/leveldb/source/browse/#svn%2Ftrunk%2Fdoc%2Fbench%2Fdb_bench_sqlite3.cc">doc/bench/db_bench_sqlite3.cc</a>.</li>
  77. <li> <b>Kyoto TreeDB:</b> <a href="http://code.google.com/p/leveldb/source/browse/#svn%2Ftrunk%2Fdoc%2Fbench%2Fdb_bench_tree_db.cc">doc/bench/db_bench_tree_db.cc</a>.</li>
  78. </ul>
  79. <h4>Custom Build Specifications</h4>
  80. <ul>
  81. <li>LevelDB: LevelDB was compiled with the <a href="http://code.google.com/p/google-perftools">tcmalloc</a> library and the <a href="http://code.google.com/p/snappy/">Snappy</a> compression library. Assertions were disabled.</li>
  82. <li>TreeDB: TreeDB was compiled using the <a href="http://www.oberhumer.com/opensource/lzo/">LZO</a> compression library. Furthermore, we enabled the TSMALL and TLINEAR options when opening the database in order to reduce the footprint of each record.</li>
  83. <li>SQLite: We tuned SQLite's performance, by setting its locking mode to exclusive. We left SQLite's <a href="http://www.sqlite.org/draft/wal.html">write-ahead logging</a> disabled since that is the default configuration. (Enabling write-ahead-logging improves SQLite's write performance by roughly 30%, but the character of the comparisons below does not change significantly.)</li>
  84. </ul>
  85. <h2>1. Baseline Performance</h2>
  86. <p>This section gives the baseline performance of a all of the
  87. databases. Following sections show how performance changes as various
  88. parameters are varied. For the baseline:</p>
  89. <ul>
  90. <li> Each database is allowed 4 MB of cache memory.</li>
  91. <li> Databases are opened in <em>asynchronous</em> write mode.
  92. (LevelDB's sync option, TreeDB's OAUTOSYNC option, and
  93. SQLite3's synchronous options are all turned off). I.e.,
  94. every write is pushed to the operating system, but the
  95. benchmark does not wait for the write to reach the disk.</li>
  96. <li> Keys are 16 bytes each.</li>
  97. <li> Value are 100 bytes each (with enough redundancy so that
  98. a simple compressor shrinks them to 50% of their original
  99. size).</li>
  100. <li> Sequential reads/writes traverse the key space in increasing order.</li>
  101. <li> Random reads/writes traverse the key space in random order.</li>
  102. </ul>
  103. <h3>A. Sequential Reads</h3>
  104. <table class="bn bnbase">
  105. <tr><td class="c1">LevelDB</td>
  106. <td class="c2">4,030,000 ops/sec</td>
  107. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  108. <tr><td class="c1">Kyoto TreeDB</td>
  109. <td class="c2">1,010,000 ops/sec</td>
  110. <td class="c3"><div class="bkct" style="width:95px">&nbsp;</div></td>
  111. <tr><td class="c1">SQLite3</td>
  112. <td class="c2">186,000 ops/sec</td>
  113. <td class="c3"><div class="bsql" style="width:16px">&nbsp;</div></td>
  114. </table>
  115. <h3>B. Random Reads</h3>
  116. <table class="bn bnbase">
  117. <tr><td class="c1">LevelDB</td>
  118. <td class="c2">129,000 ops/sec</td>
  119. <td class="c3"><div class="bldb" style="width:298px">&nbsp;</div></td>
  120. <tr><td class="c1">Kyoto TreeDB</td>
  121. <td class="c2">151,000 ops/sec</td>
  122. <td class="c3"><div class="bkct" style="width:350px">&nbsp;</div></td>
  123. <tr><td class="c1">SQLite3</td>
  124. <td class="c2">146,000 ops/sec</td>
  125. <td class="c3"><div class="bsql" style="width:337px">&nbsp;</div></td>
  126. </table>
  127. <h3>C. Sequential Writes</h3>
  128. <table class="bn bnbase">
  129. <tr><td class="c1">LevelDB</td>
  130. <td class="c2">779,000 ops/sec</td>
  131. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  132. <tr><td class="c1">Kyoto TreeDB</td>
  133. <td class="c2">342,000 ops/sec</td>
  134. <td class="c3"><div class="bkct" style="width:154px">&nbsp;</div></td>
  135. <tr><td class="c1">SQLite3</td>
  136. <td class="c2">26,900 ops/sec</td>
  137. <td class="c3"><div class="bsql" style="width:12px">&nbsp;</div></td>
  138. </table>
  139. <h3>D. Random Writes</h3>
  140. <table class="bn bnbase">
  141. <tr><td class="c1">LevelDB</td>
  142. <td class="c2">164,000 ops/sec</td>
  143. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  144. <tr><td class="c1">Kyoto TreeDB</td>
  145. <td class="c2">88,500 ops/sec</td>
  146. <td class="c3"><div class="bkct" style="width:188px">&nbsp;</div></td>
  147. <tr><td class="c1">SQLite3</td>
  148. <td class="c2">420 ops/sec</td>
  149. <td class="c3"><div class="bsql" style="width:1px">&nbsp;</div></td>
  150. </table>
  151. <p>LevelDB outperforms both SQLite3 and TreeDB in sequential and random write operations and sequential read operations. Kyoto Cabinet has the fastest random read operations.</p>
  152. <h2>2. Write Performance under Different Configurations</h2>
  153. <h3>A. Large Values </h3>
  154. <p>For this benchmark, we start with an empty database, and write 100,000 byte values (~50% compressible). To keep the benchmark running time reasonable, we stop after writing 1000 values.</p>
  155. <h4>Sequential Writes</h4>
  156. <table class="bn bnbase">
  157. <tr><td class="c1">LevelDB</td>
  158. <td class="c2">1,060 ops/sec</td>
  159. <td class="c3"><div class="bldb" style="width:127px">&nbsp;</div></td></tr>
  160. <tr><td class="c1">Kyoto TreeDB</td>
  161. <td class="c2">1,020 ops/sec</td>
  162. <td class="c3"><div class="bkct" style="width:122px">&nbsp;</div></td></tr>
  163. <tr><td class="c1">SQLite3</td>
  164. <td class="c2">2,910 ops/sec</td>
  165. <td class="c3"><div class="bsql" style="width:350px">&nbsp;</div></td></tr>
  166. </table>
  167. <h4>Random Writes</h4>
  168. <table class="bn bnbase">
  169. <tr><td class="c1">LevelDB</td>
  170. <td class="c2">480 ops/sec</td>
  171. <td class="c3"><div class="bldb" style="width:77px">&nbsp;</div></td></tr>
  172. <tr><td class="c1">Kyoto TreeDB</td>
  173. <td class="c2">1,100 ops/sec</td>
  174. <td class="c3"><div class="bkct" style="width:350px">&nbsp;</div></td></tr>
  175. <tr><td class="c1">SQLite3</td>
  176. <td class="c2">2,200 ops/sec</td>
  177. <td class="c3"><div class="bsql" style="width:175px">&nbsp;</div></td></tr>
  178. </table>
  179. <p>LevelDB doesn't perform as well with large values of 100,000 bytes each. This is because LevelDB writes keys and values at least twice: first time to the transaction log, and second time (during a compaction) to a sorted file.
  180. With larger values, LevelDB's per-operation efficiency is swamped by the
  181. cost of extra copies of large values.</p>
  182. <h3>B. Batch Writes</h3>
  183. <p>A batch write is a set of writes that are applied atomically to the underlying database. A single batch of N writes may be significantly faster than N individual writes. The following benchmark writes one thousand batches where each batch contains one thousand 100-byte values. TreeDB does not support batch writes and is omitted from this benchmark.</p>
  184. <h4>Sequential Writes</h4>
  185. <table class="bn">
  186. <tr><td class="c1">LevelDB</td>
  187. <td class="c2">840,000 entries/sec</td>
  188. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  189. <td class="c4">(1.08x baseline)</td></tr>
  190. <tr><td class="c1">SQLite3</td>
  191. <td class="c2">100,000 entries/sec</td>
  192. <td class="c3"><div class="bsql" style="width:43px">&nbsp;</div></td>
  193. <td class="c4">(3.72x baseline)</td></tr>
  194. </table>
  195. <h4>Random Writes</h4>
  196. <table class="bn">
  197. <tr><td class="c1">LevelDB</td>
  198. <td class="c2">221,000 entries/sec</td>
  199. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  200. <td class="c4">(1.35x baseline)</td></tr>
  201. <tr><td class="c1">SQLite3</td>
  202. <td class="c2">1,000 entries/sec</td>
  203. <td class="c3"><div class="bsql" style="width:2px">&nbsp;</div></td>
  204. <td class="c4">(2.38x baseline)</td></tr>
  205. </table>
  206. <p>Because of the way LevelDB persistent storage is organized, batches of
  207. random writes are not much slower (only a factor of 4x) than batches
  208. of sequential writes. However SQLite3 sees a significant slowdown
  209. (factor of 100x) when switching from sequential to random batch
  210. writes. This is because each random batch write in SQLite3 has to
  211. update approximately as many pages as there are keys in the batch.</p>
  212. <h3>C. Synchronous writes</h3>
  213. <p>In the following benchmark, we enable the synchronous writing modes
  214. of all of the databases. Since this change significantly slows down the
  215. benchmark, we stop after 10,000 writes.</p>
  216. <ul>
  217. <li>For LevelDB, we set WriteOptions.sync = true.</li>
  218. <li>In TreeDB, we enabled TreeDB's OAUTOSYNC option.</li>
  219. <li>For SQLite3, we set "PRAGMA synchronous = FULL".</li>
  220. </ul>
  221. <h4>Sequential Writes</h4>
  222. <table class="bn">
  223. <tr><td class="c1">LevelDB</td>
  224. <td class="c2">2,400 ops/sec</td>
  225. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  226. <td class="c4">(0.003x baseline)</td></tr>
  227. <tr><td class="c1">Kyoto TreeDB</td>
  228. <td class="c2">140 ops/sec</td>
  229. <td class="c3"><div class="bkct" style="width:21px">&nbsp;</div></td>
  230. <td class="c4">(0.0004x baseline)</td></tr>
  231. <tr><td class="c1">SQLite3</td>
  232. <td class="c2">430 ops/sec</td>
  233. <td class="c3"><div class="bsql" style="width:61px">&nbsp;</div></td>
  234. <td class="c4">(0.016x baseline)</td></tr>
  235. </table>
  236. <h4>Random Writes</h4>
  237. <table class="bn">
  238. <tr><td class="c1">LevelDB</td>
  239. <td class="c2">2,400 ops/sec</td>
  240. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  241. <td class="c4">(0.015x baseline)</td></tr>
  242. <tr><td class="c1">Kyoto TreeDB</td>
  243. <td class="c2">100 ops/sec</td>
  244. <td class="c3"><div class="bkct" style="width:14px">&nbsp;</div></td>
  245. <td class="c4">(0.001x baseline)</td></tr>
  246. <tr><td class="c1">SQLite3</td>
  247. <td class="c2">110 ops/sec</td>
  248. <td class="c3"><div class="bsql" style="width:16px">&nbsp;</div></td>
  249. <td class="c4">(0.26x baseline)</td></tr>
  250. </table>
  251. <p>Also see the <code>ext4</code> performance numbers below
  252. since synchronous writes behave significantly differently
  253. on <code>ext3</code> and <code>ext4</code>.</p>
  254. <h3>D. Turning Compression Off</h3>
  255. <p>In the baseline measurements, LevelDB and TreeDB were using
  256. light-weight compression
  257. (<a href="http://code.google.com/p/snappy/">Snappy</a> for LevelDB,
  258. and <a href="http://www.oberhumer.com/opensource/lzo/">LZO</a> for
  259. TreeDB). SQLite3, by default does not use compression. The
  260. experiments below show what happens when compression is disabled in
  261. all of the databases (the SQLite3 numbers are just a copy of
  262. its baseline measurements):</p>
  263. <h4>Sequential Writes</h4>
  264. <table class="bn">
  265. <tr><td class="c1">LevelDB</td>
  266. <td class="c2">594,000 ops/sec</td>
  267. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  268. <td class="c4">(0.76x baseline)</td></tr>
  269. <tr><td class="c1">Kyoto TreeDB</td>
  270. <td class="c2">485,000 ops/sec</td>
  271. <td class="c3"><div class="bkct" style="width:239px">&nbsp;</div></td>
  272. <td class="c4">(1.42x baseline)</td></tr>
  273. <tr><td class="c1">SQLite3</td>
  274. <td class="c2">26,900 ops/sec</td>
  275. <td class="c3"><div class="bsql" style="width:13px">&nbsp;</div></td>
  276. <td class="c4">(1.00x baseline)</td></tr>
  277. </table>
  278. <h4>Random Writes</h4>
  279. <table class="bn">
  280. <tr><td class="c1">LevelDB</td>
  281. <td class="c2">135,000 ops/sec</td>
  282. <td class="c3"><div class="bldb" style="width:296px">&nbsp;</div></td>
  283. <td class="c4">(0.82x baseline)</td></tr>
  284. <tr><td class="c1">Kyoto TreeDB</td>
  285. <td class="c2">159,000 ops/sec</td>
  286. <td class="c3"><div class="bkct" style="width:350px">&nbsp;</div></td>
  287. <td class="c4">(1.80x baseline)</td></tr>
  288. <tr><td class="c1">SQLite3</td>
  289. <td class="c2">420 ops/sec</td>
  290. <td class="c3"><div class="bsql" style="width:1px">&nbsp;</div></td>
  291. <td class="c4">(1.00x baseline)</td></tr>
  292. </table>
  293. <p>LevelDB's write performance is better with compression than without
  294. since compression decreases the amount of data that has to be written
  295. to disk. Therefore LevelDB users can leave compression enabled in
  296. most scenarios without having worry about a tradeoff between space
  297. usage and performance. TreeDB's performance on the other hand is
  298. better without compression than with compression. Presumably this is
  299. because TreeDB's compression library (LZO) is more expensive than
  300. LevelDB's compression library (Snappy).<p>
  301. <h3>E. Using more memory</h3>
  302. <p>We increased the overall cache size for each database to 128 MB. For LevelDB, we partitioned 128 MB into a 120 MB write buffer and 8 MB of cache (up from 2 MB of write buffer and 2 MB of cache). For SQLite3, we kept the page size at 1024 bytes, but increased the number of pages to 131,072 (up from 4096). For TreeDB, we also kept the page size at 1024 bytes, but increased the cache size to 128 MB (up from 4 MB).</p>
  303. <h4>Sequential Writes</h4>
  304. <table class="bn">
  305. <tr><td class="c1">LevelDB</td>
  306. <td class="c2">812,000 ops/sec</td>
  307. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  308. <td class="c4">(1.04x baseline)</td></tr>
  309. <tr><td class="c1">Kyoto TreeDB</td>
  310. <td class="c2">321,000 ops/sec</td>
  311. <td class="c3"><div class="bkct" style="width:138px">&nbsp;</div></td>
  312. <td class="c4">(0.94x baseline)</td></tr>
  313. <tr><td class="c1">SQLite3</td>
  314. <td class="c2">26,200 ops/sec</td>
  315. <td class="c3"><div class="bsql" style="width:11px">&nbsp;</div></td>
  316. <td class="c4">(0.97x baseline)</td></tr>
  317. </table>
  318. <h4>Random Writes</h4>
  319. <table class="bn">
  320. <tr><td class="c1">LevelDB</td>
  321. <td class="c2">355,000 ops/sec</td>
  322. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  323. <td class="c4">(2.16x baseline)</td></tr>
  324. <tr><td class="c1">Kyoto TreeDB</td>
  325. <td class="c2">284,000 ops/sec</td>
  326. <td class="c3"><div class="bkct" style="width:280px">&nbsp;</div></td>
  327. <td class="c4">(3.21x baseline)</td></tr>
  328. <tr><td class="c1">SQLite3</td>
  329. <td class="c2">450 ops/sec</td>
  330. <td class="c3"><div class="bsql" style="width:0px">&nbsp;</div></td>
  331. <td class="c4">(1.07x baseline)</td></tr>
  332. </table>
  333. <p>SQLite's performance does not change substantially when compared to
  334. the baseline, but the random write performance for both LevelDB and
  335. TreeDB increases significantly. LevelDB's performance improves
  336. because a larger write buffer reduces the need to merge sorted files
  337. (since it creates a smaller number of larger sorted files). TreeDB's
  338. performance goes up because the entire database is available in memory
  339. for fast in-place updates.</p>
  340. <h2>2. Read Performance under Different Configurations</h2>
  341. <h3>A. Larger caches</h3>
  342. <p>We increased the overall memory usage to 128 MB for each database.
  343. For LevelDB, we allocated 8 MB to LevelDB's write buffer and 120 MB
  344. to LevelDB's cache. The other databases don't differentiate between a
  345. write buffer and a cache, so we simply set their cache size to 128
  346. MB.</p>
  347. <h4>Sequential Reads</h4>
  348. <table class="bn">
  349. <tr><td class="c1">LevelDB</td>
  350. <td class="c2">5,210,000 ops/sec</td>
  351. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  352. <td class="c4">(1.29x baseline)</td></tr>
  353. <tr><td class="c1">Kyoto TreeDB</td>
  354. <td class="c2">1,070,000 ops/sec</td>
  355. <td class="c3"><div class="bkct" style="width:72px">&nbsp;</div></td>
  356. <td class="c4">(1.06x baseline)</td></tr>
  357. <tr><td class="c1">SQLite3</td>
  358. <td class="c2">221,000 ops/sec</td>
  359. <td class="c3"><div class="bsql" style="width:15px">&nbsp;</div></td>
  360. <td class="c4">(1.19x baseline)</td></tr>
  361. </table>
  362. <h4>Random Reads</h4>
  363. <table class="bn">
  364. <tr><td class="c1">LevelDB</td>
  365. <td class="c2">190,000 ops/sec</td>
  366. <td class="c3"><div class="bldb" style="width:144px">&nbsp;</div></td>
  367. <td class="c4">(1.47x baseline)</td></tr>
  368. <tr><td class="c1">Kyoto TreeDB</td>
  369. <td class="c2">463,000 ops/sec</td>
  370. <td class="c3"><div class="bkct" style="width:350px">&nbsp;</div></td>
  371. <td class="c4">(3.07x baseline)</td></tr>
  372. <tr><td class="c1">SQLite3</td>
  373. <td class="c2">197,000 ops/sec</td>
  374. <td class="c3"><div class="bsql" style="width:149px">&nbsp;</div></td>
  375. <td class="c4">(1.35x baseline)</td></tr>
  376. </table>
  377. <p>As expected, the read performance of all of the databases increases
  378. when the caches are enlarged. In particular, TreeDB seems to make
  379. very effective use of a cache that is large enough to hold the entire
  380. database.</p>
  381. <h3>B. No compression reads </h3>
  382. <p>For this benchmark, we populated a database with 1 million entries consisting of 16 byte keys and 100 byte values. We compiled LevelDB and Kyoto Cabinet without compression support, so results that are read out from the database are already uncompressed. We've listed the SQLite3 baseline read performance as a point of comparison.</p>
  383. <h4>Sequential Reads</h4>
  384. <table class="bn">
  385. <tr><td class="c1">LevelDB</td>
  386. <td class="c2">4,880,000 ops/sec</td>
  387. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  388. <td class="c4">(1.21x baseline)</td></tr>
  389. <tr><td class="c1">Kyoto TreeDB</td>
  390. <td class="c2">1,230,000 ops/sec</td>
  391. <td class="c3"><div class="bkct" style="width:88px">&nbsp;</div></td>
  392. <td class="c4">(3.60x baseline)</td></tr>
  393. <tr><td class="c1">SQLite3</td>
  394. <td class="c2">186,000 ops/sec</td>
  395. <td class="c3"><div class="bsql" style="width:13px">&nbsp;</div></td>
  396. <td class="c4">(1.00x baseline)</td></tr>
  397. </table>
  398. <h4>Random Reads</h4>
  399. <table class="bn">
  400. <tr><td class="c1">LevelDB</td>
  401. <td class="c2">149,000 ops/sec</td>
  402. <td class="c3"><div class="bldb" style="width:300px">&nbsp;</div></td>
  403. <td class="c4">(1.16x baseline)</td></tr>
  404. <tr><td class="c1">Kyoto TreeDB</td>
  405. <td class="c2">175,000 ops/sec</td>
  406. <td class="c3"><div class="bkct" style="width:350px">&nbsp;</div></td>
  407. <td class="c4">(1.16x baseline)</td></tr>
  408. <tr><td class="c1">SQLite3</td>
  409. <td class="c2">146,000 ops/sec</td>
  410. <td class="c3"><div class="bsql" style="width:292px">&nbsp;</div></td>
  411. <td class="c4">(1.00x baseline)</td></tr>
  412. </table>
  413. <p>Performance of both LevelDB and TreeDB improves a small amount when
  414. compression is disabled. Note however that under different workloads,
  415. performance may very well be better with compression if it allows more
  416. of the working set to fit in memory.</p>
  417. <h2>Note about Ext4 Filesystems</h2>
  418. <p>The preceding numbers are for an ext3 file system. Synchronous writes are much slower under <a href="http://en.wikipedia.org/wiki/Ext4">ext4</a> (LevelDB drops to ~34 writes / second, TreeDB drops to ~5 writes / second; SQLite3 drops to ~24 writes / second) due to ext4's different handling of <span class="code">fsync</span> / <span class="code">msync</span> calls. Even LevelDB's asynchronous write performance drops somewhat since it spreads its storage across multiple files and issues <span class="code">fsync</span> calls when switching to a new file.</p>
  419. <h2>Acknowledgements</h2>
  420. <p>Jeff Dean and Sanjay Ghemawat wrote LevelDB. Kevin Tseng wrote and compiled these benchmarks. Mikio Hirabayashi, Scott Hess, and Gabor Cselle provided help and advice.</p>
  421. </body>
  422. </html>