3
回答
LevelDB 和 Kyoto Cabinet 的性能比较
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   

本文翻译自:http://maxpert.tumblr.com/

作者通过各种情况下对 Google 新兴的 LevelDB 和老牌的 Kyoto Cabinet 进行实际的数据对比性能测试。

1. 小字符串数据插入(10万条数据)

Kyoto Cabinet 100,000 entries:

  • Time consumed was 0.328945
    Time consumed was 0.207315
  • Time consumed was 0.286653
    Time consumed was 0.210296
  • Time consumed was 0.284954
    Time consumed was 0.208595

LevelDB 100,000 entries:

  • Time consumed was 0.44742
    Time consumed was 0.171842
  • Time consumed was 0.449287
    Time consumed was 0.169108
  • Time consumed was 0.444432
    Time consumed was 0.169381

2. 定长(512直接)字符串数据插入10万条

Kyoto Cabinet HashDB 512 bytes 100,000 entries:

  • Time consumed was 0.549354
    Time consumed was 0.249182
  • Time consumed was 0.451567
    Time consumed was 0.236295
  • Time consumed was 0.568072
    Time consumed was 0.240299

LevelDB 512 bytes 100,000 entries:

  • Time consumed was 5.09164
    Time consumed was 0.302542
  • Time consumed was 5.16017
    Time consumed was 0.301258
  • Time consumed was 5.32948
    Time consumed was 0.300175

TreeDB with Fixed 512 byte value length:

  • Time consumed was 0.393798
    Time consumed was 0.445125
  • Time consumed was 0.389259
    Time consumed was 0.439923
  • Time consumed was 0.392562
    Time consumed was 0.438211

TreeDB with small length values (same as 1st HashDB benchmarks above):

  • Time consumed was 0.39401
    Time consumed was 0.322735
  • Time consumed was 0.445422
    Time consumed was 0.349465
  • Time consumed was 0.287259
    Time consumed was 0.258459

3. 将数据扩大到 100万条

LevelDB 1,000,000 entries (small values to give it an advantage):

  • Time consumed was 5.9836
    Time consumed was 1.91519
  • Time consumed was 6.03402
    Time consumed was 1.90402
  • Time consumed was 6.01079
    Time consumed was 1.88251

TreeDB 1,000,000 entries (small values):

  • Time consumed was 3.9333
    Time consumed was 2.56793
  • Time consumed was 3.87633
    Time consumed was 2.56836
  • Time consumed was 3.93033
    Time consumed was 2.57917

是否对这个测试结果非常的惊奇?没错!我不知道我这个测试会不会有什么不足的地方,希望在实际的应用中进一步测试。

另外这里还有一份 LevelDB 官方的性能测试文档:

http://leveldb.googlecode.com/svn/trunk/doc/benchmark.html

举报
红薯
发帖于6年前 3回/3K+阅
顶部