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

tornado 接口里的操作时间差远远大于脚本的时间差

  •  
  •   Morriaty · Jul 3, 2017 · 2223 views
    This topic created in 3370 days ago, the information mentioned may be changed or developed.

    接口里有个逻辑如下

    st = time.time()
    most_common_id = Counter(id_list).most_common(5000)
    ed = time.time()
    print("most common cost time %s", et - st)
    

    其中,id_list是个 15w 长度的 list,Counter 之后是 10w 长度。

    但在接口里要花接近 400ms,脚本直接执行的话,只要 200ms,都是平均时长。

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   835 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 21:18 · PVG 05:18 · LAX 14:18 · JFK 17:18
    ♥ Do have faith in what you're doing.