V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
chuangbo
V2EX  ›  Python

没想到 zipfile 这么快,用 python 写的 key-value 数据库,核心代码 20 行,封装了 zipfile,每秒插入读取 8000 次左右

  •  
  •   chuangbo · Jun 19, 2012 · 4916 views
    This topic created in 5066 days ago, the information mentioned may be changed or developed.

    数据存在 zip 压缩包里,文件名为 key,内容是 value,每个操作都落地,简单的难以想象。
    4 replies    1970-01-01 08:00:00 +08:00
    chuangbo
        1
    chuangbo  
    OP
       Jun 19, 2012
    咦,gist 不会自动转换了吗?
    lyxint
        2
    lyxint  
       Jun 19, 2012   ❤️ 1
    zipdb对一个key多次写入不是覆盖而是追加, 且不能删除k/v对, 因为不支持__delitem__
    benchmark下来还是比semidbm差很多, 见 http://dpaste.com/761151/
    当然比代码少zipdb赢了
    xinkiang
        3
    xinkiang  
       Jun 19, 2012
    @chuangbo 去掉https的s
    Kai
        4
    Kai  
       Jun 19, 2012
    @xinkiang @chuangbo 调整了一下 :)
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2337 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 37ms · UTC 15:38 · PVG 23:38 · LAX 08:38 · JFK 11:38
    ♥ Do have faith in what you're doing.