ISUCONアプリを Pythonで書いてみた

2,618 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,618
On SlideShare
0
From Embeds
0
Number of Embeds
442
Actions
Shares
0
Downloads
9
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • ISUCONアプリを Pythonで書いてみた

    1. 1. ISUCONPython 2011.09.06 #4 LT
    2. 2. • HN: • id:memememomo • Twitter (@memememomo) • github (memememomo)• ISUCON •• • perl PHP
    3. 3. ISUCON• ruby • Sinatra• perl • Kossy• node.js • express
    4. 4. ISUCON• ruby use Kossy; • Sinatra get /article/:articleid => sub {• perl my ( $self, $c ) = @_; • Kossy $c->render(article.tx, { article =>• node.js $article, comments => $comments }); }; • express
    5. 5. ISUCON• ruby use Kossy; • Sinatra get /article/:articleid => sub {• perl my ( $self, $c ) = @_; • Kossy $c->render(article.tx, { article =>• node.js $article, comments => $comments }); }; • express
    6. 6. ISUCON• ruby use Kossy; • Sinatra get /article/:articleid => sub {• perl my ( $self, $c ) = @_; • Kossy $c->render(article.tx, { article =>• node.js $article, comments => $comments }); }; • express
    7. 7. ISUCON• ruby use Kossy; • Sinatra get /article/:articleid => sub {• perl my ( $self, $c ) = @_; • Kossy $c->render(article.tx, { article =>• node.js $article, comments => $comments }); }; • express
    8. 8. ISUCON• ruby use Kossy; • Sinatra get /article/:articleid => sub {• perl my ( $self, $c ) = @_; • Kossy $c->render(article.tx, { article =>• node.js $article, comments => $comments }); }; • express Python Flask
    9. 9. Flask from flask import Flask app = Flask(__name__) @app.route(/) def index(): .....     return render_template(index.html, articles=articles, sidebaritems=g.sidebaritems) @app.route(/post, methods=[GET]) def get_post():     return render_template(post.html) @app.route(/post, methods=[POST]) def post_post(): .....     return redirect(url_for(index)) if __name__ == __main__:     app.run(host=0.0.0.0)https://github.com/memememomo/python-isucon
    10. 10. Flask from flask import Flask app = Flask(__name__) @app.route(/) def index(): .....     return render_template(index.html, articles=articles, sidebaritems=g.sidebaritems) @app.route(/post, methods=[GET]) def get_post():     return render_template(post.html) @app.route(/post, methods=[POST]) def post_post(): .....     return redirect(url_for(index)) if __name__ == __main__:     app.run(host=0.0.0.0)https://github.com/memememomo/python-isucon
    11. 11. Flask from flask import Flask app = Flask(__name__) @app.route(/) def index(): .....     return render_template(index.html, articles=articles, sidebaritems=g.sidebaritems) @app.route(/post, methods=[GET]) def get_post():     return render_template(post.html) @app.route(/post, methods=[POST]) def post_post(): .....     return redirect(url_for(index)) if __name__ == __main__:     app.run(host=0.0.0.0)https://github.com/memememomo/python-isucon
    12. 12. Flask from flask import Flask app = Flask(__name__) @app.route(/) def index(): .....     return render_template(index.html, articles=articles, sidebaritems=g.sidebaritems) @app.route(/post, methods=[GET]) def get_post():     return render_template(post.html) @app.route(/post, methods=[POST]) def post_post(): .....     return redirect(url_for(index)) if __name__ == __main__:     app.run(host=0.0.0.0)https://github.com/memememomo/python-isucon
    13. 13. Flask from flask import Flask app = Flask(__name__) @app.route(/) def index(): .....     return render_template(index.html, articles=articles, sidebaritems=g.sidebaritems) @app.route(/post, methods=[GET]) def get_post():     return render_template(post.html) @app.route(/post, methods=[POST]) def post_post(): .....     return redirect(url_for(index)) if __name__ == __main__:     app.run(host=0.0.0.0)https://github.com/memememomo/python-isucon
    14. 14. Flask from flask import Flask app = Flask(__name__) @app.route(/) def index(): .....     return render_template(index.html, articles=articles, sidebaritems=g.sidebaritems) @app.route(/post, methods=[GET]) def get_post():     return render_template(post.html) @app.route(/post, methods=[POST]) def post_post(): .....     return redirect(url_for(index)) if __name__ == __main__:     app.run(host=0.0.0.0)https://github.com/memememomo/python-isucon
    15. 15. • App•• http_load 2• App • app1 (perl + starman) • app2 (ruby + apache + passenger) • app3 (node.js) • app4 (python + apache + mod_wsgi)
    16. 16. • • python isucon •• •

    ×