Weitere ähnliche Inhalte
Ähnlich wie ISUCONアプリを Pythonで書いてみた (20)
Kürzlich hochgeladen (20)
ISUCONアプリを Pythonで書いてみた
- 2. • HN:
• id:memememomo
• Twitter (@memememomo)
• github (memememomo)
• ISUCON
•
•
• perl PHP
- 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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
- 16. • App
•
• http_load 2
• App
• app1 (perl + starman)
• app2 (ruby + apache + passenger)
• app3 (node.js)
• app4 (python + apache + mod_wsgi)
- 18. •
• python isucon
•
•
•
Hinweis der Redaktion
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n
- \n