V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
startover
V2EX  ›  Python

Python Flask vs Ruby Sinatra vs Go Martini vs Node Express

  •  
  •   startover · 2016-03-15 19:21:04 +08:00 · 4253 次点击
    这是一个创建于 2971 天前的主题,其中的信息可能已经有所发展或是发生改变。
    https://github.com/startover/fibonacci-webapp-benchmark

    拿走不谢。其实我是来刷脸的...
    9 条回复    2016-03-15 22:39:42 +08:00
    loading
        1
    loading  
       2016-03-15 19:49:29 +08:00 via Android
    头像都没有…谁认得你!
    startover
        2
    startover  
    OP
       2016-03-15 20:56:30 +08:00
    @loading 别闹...
    est
        3
    est  
       2016-03-15 21:43:38 +08:00
    python app.py 好吧。

    用 ab 来测试。。好吧。
    timothyye
        4
    timothyye  
       2016-03-15 22:03:09 +08:00
    为啥选 Martini 呢,选 Gin 的话估计性能更优一些……
    https://github.com/gin-gonic/gin

    gin 的 GitHub 主页上有 gin 与其他 Go http router 的性能对比。
    janxin
        5
    janxin  
       2016-03-15 22:12:33 +08:00 via iPhone
    这个测试没有任何意义啊…
    bearqq
        6
    bearqq  
       2016-03-15 22:28:30 +08:00 via Android
    不挂个 gunicorn 再挂个 nginx 么。。。
    startover
        7
    startover  
    OP
       2016-03-15 22:31:04 +08:00
    @timothyye 主要是个人精力有限...这个项目主要是起到抛砖引玉的作用,如果大家觉得有自己喜欢的框架,我也可以考虑加进去,当然,也欢迎给我提交 PR^_^
    startover
        8
    startover  
    OP
       2016-03-15 22:36:05 +08:00
    @bearqq 目前只是纯框架层面的对比,如果考虑 gevent , pypy , gunicorn , nginx 这些,情况就复杂了...
    matsuijurina
        9
    matsuijurina  
       2016-03-15 22:39:42 +08:00
    Golang 如果换成 Echo 这个轻型框架,更快。它用俄国人做的 fasthttp 库替代了官方的 net/http 库,某些情况下速度有 2-10 倍的提升。 nginx 也是俄国人写的,战斗民族搞这个确实厉害。我实测过了,做 api server 返回简单 json , Echo 比 Rails5 快十几倍。但是业务逻辑变复杂后,数据库和消息队列这些才是真正需要优化的瓶颈。已有项目你用哪种语言顺手就继续用那个好了,确实有高并发需求的时候,可以选用 Echo 写 api server 。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2044 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 16:07 · PVG 00:07 · LAX 09:07 · JFK 12:07
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.