提供基本的ttl测试用例
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.

467 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">
  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>
  160. <td class="c4">(1.17x baseline)</td></tr>
  161. <tr><td class="c1">Kyoto TreeDB</td>
  162. <td class="c2">1,020 ops/sec</td>
  163. <td class="c3"><div class="bkct" style="width:122px">&nbsp;</div></td>
  164. <td class="c4">(2.57x baseline)</td></tr>
  165. <tr><td class="c1">SQLite3</td>
  166. <td class="c2">2,910 ops/sec</td>
  167. <td class="c3"><div class="bsql" style="width:350px">&nbsp;</div></td>
  168. <td class="c4">(93.3x baseline)</td></tr>
  169. </table>
  170. <h4>Random Writes</h4>
  171. <table class="bn">
  172. <tr><td class="c1">LevelDB</td>
  173. <td class="c2">480 ops/sec</td>
  174. <td class="c3"><div class="bldb" style="width:77px">&nbsp;</div></td>
  175. <td class="c4">(2.52x baseline)</td></tr>
  176. <tr><td class="c1">Kyoto TreeDB</td>
  177. <td class="c2">1,100 ops/sec</td>
  178. <td class="c3"><div class="bkct" style="width:350px">&nbsp;</div></td>
  179. <td class="c4">(10.72x baseline)</td></tr>
  180. <tr><td class="c1">SQLite3</td>
  181. <td class="c2">2,200 ops/sec</td>
  182. <td class="c3"><div class="bsql" style="width:175px">&nbsp;</div></td>
  183. <td class="c4">(4,516x baseline)</td></tr>
  184. </table>
  185. <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.
  186. With larger values, LevelDB's per-operation efficiency is swamped by the
  187. cost of extra copies of large values.</p>
  188. <h3>B. Batch Writes</h3>
  189. <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>
  190. <h4>Sequential Writes</h4>
  191. <table class="bn">
  192. <tr><td class="c1">LevelDB</td>
  193. <td class="c2">840,000 entries/sec</td>
  194. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  195. <td class="c4">(1.08x baseline)</td></tr>
  196. <tr><td class="c1">SQLite3</td>
  197. <td class="c2">100,000 entries/sec</td>
  198. <td class="c3"><div class="bsql" style="width:43px">&nbsp;</div></td>
  199. <td class="c4">(3.72x baseline)</td></tr>
  200. </table>
  201. <h4>Random Writes</h4>
  202. <table class="bn">
  203. <tr><td class="c1">LevelDB</td>
  204. <td class="c2">221,000 entries/sec</td>
  205. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  206. <td class="c4">(1.35x baseline)</td></tr>
  207. <tr><td class="c1">SQLite3</td>
  208. <td class="c2">1,000 entries/sec</td>
  209. <td class="c3"><div class="bsql" style="width:2px">&nbsp;</div></td>
  210. <td class="c4">(2.38x baseline)</td></tr>
  211. </table>
  212. <p>Because of the way LevelDB persistent storage is organized, batches of
  213. random writes are not much slower (only a factor of 4x) than batches
  214. of sequential writes. However SQLite3 sees a significant slowdown
  215. (factor of 100x) when switching from sequential to random batch
  216. writes. This is because each random batch write in SQLite3 has to
  217. update approximately as many pages as there are keys in the batch.</p>
  218. <h3>C. Synchronous writes</h3>
  219. <p>In the following benchmark, we enable the synchronous writing modes
  220. of all of the databases. Since this change significantly slows down the
  221. benchmark, we stop after 10,000 writes.</p>
  222. <ul>
  223. <li>For LevelDB, we set WriteOptions.sync = true.</li>
  224. <li>In TreeDB, we enabled TreeDB's OAUTOSYNC option.</li>
  225. <li>For SQLite3, we set "PRAGMA synchronous = FULL".</li>
  226. </ul>
  227. <h4>Sequential Writes</h4>
  228. <table class="bn">
  229. <tr><td class="c1">LevelDB</td>
  230. <td class="c2">2,400 ops/sec</td>
  231. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  232. <td class="c4">(0.003x baseline)</td></tr>
  233. <tr><td class="c1">Kyoto TreeDB</td>
  234. <td class="c2">140 ops/sec</td>
  235. <td class="c3"><div class="bkct" style="width:21px">&nbsp;</div></td>
  236. <td class="c4">(0.0004x baseline)</td></tr>
  237. <tr><td class="c1">SQLite3</td>
  238. <td class="c2">430 ops/sec</td>
  239. <td class="c3"><div class="bsql" style="width:61px">&nbsp;</div></td>
  240. <td class="c4">(0.016x baseline)</td></tr>
  241. </table>
  242. <h4>Random Writes</h4>
  243. <table class="bn">
  244. <tr><td class="c1">LevelDB</td>
  245. <td class="c2">2,400 ops/sec</td>
  246. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  247. <td class="c4">(0.015x baseline)</td></tr>
  248. <tr><td class="c1">Kyoto TreeDB</td>
  249. <td class="c2">100 ops/sec</td>
  250. <td class="c3"><div class="bkct" style="width:14px">&nbsp;</div></td>
  251. <td class="c4">(0.001x baseline)</td></tr>
  252. <tr><td class="c1">SQLite3</td>
  253. <td class="c2">110 ops/sec</td>
  254. <td class="c3"><div class="bsql" style="width:16px">&nbsp;</div></td>
  255. <td class="c4">(0.26x baseline)</td></tr>
  256. </table>
  257. <p>Also see the <code>ext4</code> performance numbers below
  258. since synchronous writes behave significantly differently
  259. on <code>ext3</code> and <code>ext4</code>.</p>
  260. <h3>D. Turning Compression Off</h3>
  261. <p>In the baseline measurements, LevelDB and TreeDB were using
  262. light-weight compression
  263. (<a href="http://code.google.com/p/snappy/">Snappy</a> for LevelDB,
  264. and <a href="http://www.oberhumer.com/opensource/lzo/">LZO</a> for
  265. TreeDB). SQLite3, by default does not use compression. The
  266. experiments below show what happens when compression is disabled in
  267. all of the databases (the SQLite3 numbers are just a copy of
  268. its baseline measurements):</p>
  269. <h4>Sequential Writes</h4>
  270. <table class="bn">
  271. <tr><td class="c1">LevelDB</td>
  272. <td class="c2">594,000 ops/sec</td>
  273. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  274. <td class="c4">(0.76x baseline)</td></tr>
  275. <tr><td class="c1">Kyoto TreeDB</td>
  276. <td class="c2">485,000 ops/sec</td>
  277. <td class="c3"><div class="bkct" style="width:239px">&nbsp;</div></td>
  278. <td class="c4">(1.42x baseline)</td></tr>
  279. <tr><td class="c1">SQLite3</td>
  280. <td class="c2">26,900 ops/sec</td>
  281. <td class="c3"><div class="bsql" style="width:13px">&nbsp;</div></td>
  282. <td class="c4">(1.00x baseline)</td></tr>
  283. </table>
  284. <h4>Random Writes</h4>
  285. <table class="bn">
  286. <tr><td class="c1">LevelDB</td>
  287. <td class="c2">135,000 ops/sec</td>
  288. <td class="c3"><div class="bldb" style="width:296px">&nbsp;</div></td>
  289. <td class="c4">(0.82x baseline)</td></tr>
  290. <tr><td class="c1">Kyoto TreeDB</td>
  291. <td class="c2">159,000 ops/sec</td>
  292. <td class="c3"><div class="bkct" style="width:350px">&nbsp;</div></td>
  293. <td class="c4">(1.80x baseline)</td></tr>
  294. <tr><td class="c1">SQLite3</td>
  295. <td class="c2">420 ops/sec</td>
  296. <td class="c3"><div class="bsql" style="width:1px">&nbsp;</div></td>
  297. <td class="c4">(1.00x baseline)</td></tr>
  298. </table>
  299. <p>LevelDB's write performance is better with compression than without
  300. since compression decreases the amount of data that has to be written
  301. to disk. Therefore LevelDB users can leave compression enabled in
  302. most scenarios without having worry about a tradeoff between space
  303. usage and performance. TreeDB's performance on the other hand is
  304. better without compression than with compression. Presumably this is
  305. because TreeDB's compression library (LZO) is more expensive than
  306. LevelDB's compression library (Snappy).<p>
  307. <h3>E. Using more memory</h3>
  308. <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>
  309. <h4>Sequential Writes</h4>
  310. <table class="bn">
  311. <tr><td class="c1">LevelDB</td>
  312. <td class="c2">812,000 ops/sec</td>
  313. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  314. <td class="c4">(1.04x baseline)</td></tr>
  315. <tr><td class="c1">Kyoto TreeDB</td>
  316. <td class="c2">321,000 ops/sec</td>
  317. <td class="c3"><div class="bkct" style="width:138px">&nbsp;</div></td>
  318. <td class="c4">(0.94x baseline)</td></tr>
  319. <tr><td class="c1">SQLite3</td>
  320. <td class="c2">26,200 ops/sec</td>
  321. <td class="c3"><div class="bsql" style="width:11px">&nbsp;</div></td>
  322. <td class="c4">(0.97x baseline)</td></tr>
  323. </table>
  324. <h4>Random Writes</h4>
  325. <table class="bn">
  326. <tr><td class="c1">LevelDB</td>
  327. <td class="c2">355,000 ops/sec</td>
  328. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  329. <td class="c4">(2.16x baseline)</td></tr>
  330. <tr><td class="c1">Kyoto TreeDB</td>
  331. <td class="c2">284,000 ops/sec</td>
  332. <td class="c3"><div class="bkct" style="width:280px">&nbsp;</div></td>
  333. <td class="c4">(3.21x baseline)</td></tr>
  334. <tr><td class="c1">SQLite3</td>
  335. <td class="c2">450 ops/sec</td>
  336. <td class="c3"><div class="bsql" style="width:0px">&nbsp;</div></td>
  337. <td class="c4">(1.07x baseline)</td></tr>
  338. </table>
  339. <p>SQLite's performance does not change substantially when compared to
  340. the baseline, but the random write performance for both LevelDB and
  341. TreeDB increases significantly. LevelDB's performance improves
  342. because a larger write buffer reduces the need to merge sorted files
  343. (since it creates a smaller number of larger sorted files). TreeDB's
  344. performance goes up because the entire database is available in memory
  345. for fast in-place updates.</p>
  346. <h2>2. Read Performance under Different Configurations</h2>
  347. <h3>A. Larger caches</h3>
  348. <p>We increased the overall memory usage to 128 MB for each database.
  349. For LevelDB, we allocated 8 MB to LevelDB's write buffer and 120 MB
  350. to LevelDB's cache. The other databases don't differentiate between a
  351. write buffer and a cache, so we simply set their cache size to 128
  352. MB.</p>
  353. <h4>Sequential Reads</h4>
  354. <table class="bn">
  355. <tr><td class="c1">LevelDB</td>
  356. <td class="c2">5,210,000 ops/sec</td>
  357. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  358. <td class="c4">(1.29x baseline)</td></tr>
  359. <tr><td class="c1">Kyoto TreeDB</td>
  360. <td class="c2">1,070,000 ops/sec</td>
  361. <td class="c3"><div class="bkct" style="width:72px">&nbsp;</div></td>
  362. <td class="c4">(1.06x baseline)</td></tr>
  363. <tr><td class="c1">SQLite3</td>
  364. <td class="c2">221,000 ops/sec</td>
  365. <td class="c3"><div class="bsql" style="width:15px">&nbsp;</div></td>
  366. <td class="c4">(1.19x baseline)</td></tr>
  367. </table>
  368. <h4>Random Reads</h4>
  369. <table class="bn">
  370. <tr><td class="c1">LevelDB</td>
  371. <td class="c2">190,000 ops/sec</td>
  372. <td class="c3"><div class="bldb" style="width:144px">&nbsp;</div></td>
  373. <td class="c4">(1.47x baseline)</td></tr>
  374. <tr><td class="c1">Kyoto TreeDB</td>
  375. <td class="c2">463,000 ops/sec</td>
  376. <td class="c3"><div class="bkct" style="width:350px">&nbsp;</div></td>
  377. <td class="c4">(3.07x baseline)</td></tr>
  378. <tr><td class="c1">SQLite3</td>
  379. <td class="c2">197,000 ops/sec</td>
  380. <td class="c3"><div class="bsql" style="width:149px">&nbsp;</div></td>
  381. <td class="c4">(1.35x baseline)</td></tr>
  382. </table>
  383. <p>As expected, the read performance of all of the databases increases
  384. when the caches are enlarged. In particular, TreeDB seems to make
  385. very effective use of a cache that is large enough to hold the entire
  386. database.</p>
  387. <h3>B. No compression reads </h3>
  388. <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>
  389. <h4>Sequential Reads</h4>
  390. <table class="bn">
  391. <tr><td class="c1">LevelDB</td>
  392. <td class="c2">4,880,000 ops/sec</td>
  393. <td class="c3"><div class="bldb" style="width:350px">&nbsp;</div></td>
  394. <td class="c4">(1.21x baseline)</td></tr>
  395. <tr><td class="c1">Kyoto TreeDB</td>
  396. <td class="c2">1,230,000 ops/sec</td>
  397. <td class="c3"><div class="bkct" style="width:88px">&nbsp;</div></td>
  398. <td class="c4">(3.60x baseline)</td></tr>
  399. <tr><td class="c1">SQLite3</td>
  400. <td class="c2">186,000 ops/sec</td>
  401. <td class="c3"><div class="bsql" style="width:13px">&nbsp;</div></td>
  402. <td class="c4">(1.00x baseline)</td></tr>
  403. </table>
  404. <h4>Random Reads</h4>
  405. <table class="bn">
  406. <tr><td class="c1">LevelDB</td>
  407. <td class="c2">149,000 ops/sec</td>
  408. <td class="c3"><div class="bldb" style="width:300px">&nbsp;</div></td>
  409. <td class="c4">(1.16x baseline)</td></tr>
  410. <tr><td class="c1">Kyoto TreeDB</td>
  411. <td class="c2">175,000 ops/sec</td>
  412. <td class="c3"><div class="bkct" style="width:350px">&nbsp;</div></td>
  413. <td class="c4">(1.16x baseline)</td></tr>
  414. <tr><td class="c1">SQLite3</td>
  415. <td class="c2">146,000 ops/sec</td>
  416. <td class="c3"><div class="bsql" style="width:292px">&nbsp;</div></td>
  417. <td class="c4">(1.00x baseline)</td></tr>
  418. </table>
  419. <p>Performance of both LevelDB and TreeDB improves a small amount when
  420. compression is disabled. Note however that under different workloads,
  421. performance may very well be better with compression if it allows more
  422. of the working set to fit in memory.</p>
  423. <h2>Note about Ext4 Filesystems</h2>
  424. <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>
  425. <h2>Acknowledgements</h2>
  426. <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>
  427. </body>
  428. </html>