推荐学习书目
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
preyta
V2EX  ›  Python

小白写了个 Bloomfilter,求指点

  •  
  •   preyta · Jun 9, 2017 · 3607 views
    This topic created in 3259 days ago, the information mentioned may be changed or developed.

    第一次写了一个完整的小工具,不知道写得怎么样,求各位大大指点一下 Github pybloomfilter

    Supplement 1  ·  Jun 11, 2017
    写了一篇介绍的文章,继续求建议
    [用 Python 从零开始实现一个 Bloomfilter]( http://blog.csdn.net/preyta)
    11 replies    2017-06-10 17:59:22 +08:00
    hwding
        1
    hwding  
       Jun 9, 2017
    提个小建议,README 里面,ops 的 ps 已经有每秒的意思,就不需要 /s 了。
    preyta
        2
    preyta  
    OP
       Jun 9, 2017
    @hwding 恩,谢谢,我这就去改正回来,想问下 ops 是 operation per sec 吗?
    EmdeBoas
        3
    EmdeBoas  
       Jun 9, 2017
    挺不错的,建议除了可以 save 和 restore 之外 还可以直接在持久化的文件上进行 add 另外 fpp 那个测试还是草率了点,弄点实际的 URL 去测吧...
    preyta
        4
    preyta  
    OP
       Jun 9, 2017
    @EmdeBoas 恩,这个测试是太草率了点...
    Systemd
        5
    Systemd  
       Jun 9, 2017 via Android
    >>> filter_ = Bloomfilter(1000, 0.001)

    # set size of input 1000, error rate 1%

    1% 不应该是 0.01 么?
    hwding
        6
    hwding  
       Jun 9, 2017
    @preyta 应该是的吧 :)
    preyta
        7
    preyta  
    OP
       Jun 9, 2017 via iPhone
    @Systemd 嗯嗯,前面写测试的时候手贱了,看得好仔细
    preyta
        9
    preyta  
    OP
       Jun 10, 2017 via iPhone
    @waruqi 前面查资料的时候也有看过你这个博客
    prasanta
        10
    prasanta  
       Jun 10, 2017
    可以贴一下各项速度和 python 内置的 set 对比图么
    preyta
        11
    preyta  
    OP
       Jun 10, 2017
    @prasanta 刚才粗略的测试了一下,输入在一亿数量级往下的时候 set 还是快不少的,用不着 bloomfilter,但是当 set 的内存开销达到系统瓶颈时,性能会急剧下降,在我的机器上测试了三亿次插入操作,速度已经降到了 355ops,不过我的机器也就 8G 内存。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1596 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 16:38 · PVG 00:38 · LAX 09:38 · JFK 12:38
    ♥ Do have faith in what you're doing.