There is an article where the author tries to compare performance of different web stacks. The result looks pretty controversial.I try to prove that in real use case the difference between scores of different stacks will be not so significant(under real I mean something which relies on database) .For this purpose I take two stacks: one from the top side(node+express) and the looser(python+flask). And now I'm trying to implement a little bit more realistic use case for both platforms.This is the code for the flask application:#app.pyfrom flask import render_templatefrom flask import Flaskimport sqlite3conn = sqlite3.connect('data.db')app = Flask(__name__)c = conn.cursor()if c.execute(SELECT name FROM sqlite_master WHERE type='table' AND name='data').fetchone() is None:    c.execute(CREATE TABLE data (value TEXT))    conn.commit()conn.close()@app.route('/<int:number>')def index(number=1):    conn = sqlite3.connect('data.db')    c = conn.cursor()    c.executemany(INSERT INTO data VALUES (?),   [(fib(number),)] * 10);    list = c.execute(select * from data limit 100).fetchall()    conn.commit()    conn.close()    return render_template('template.html', list=list)def fib(n):    if n == 0: return 0    elif n == 1: return 1    else:        return fib(n - 1) + fib(n - 2)if __name__ == '__main__':    app.run(debug=False)#template.html<ul>{% for l in list %}    <li>{{ l[0] }}</li>{% endfor %}</ul>And the code for node application:// app.jsvar express = require(express);var jade = require('jade');var db = new (require('sqlite3').verbose()).Database('data.db');var app = express();var fib = function (n) {  if (n === 0) {    return 0;  } else if (n == 1) {    return 1;  } else {    return fib(n-1) + fib(n-2)  }};var getApp = function () {    app.get(/:number, function (req, res) {      var number = req.param(number);       query = db.prepare(INSERT INTO data VALUES (?))      for(var i=0; i<10; i++) {        query.run((fib(number)))      };      db.all(select * from data limit 100, function(err, rows){        var rendered = jade.renderFile('template.jade', {list: rows})        res.send(rendered);       });    });    app.listen(3000);}db.get(  SELECT name FROM sqlite_master WHERE type='table' AND name='data',  function (err, row) {    if(err !== null) {      throw new Error();    }    if(row === undefined) {      db.run('create table data (value text)', getApp)    } else {      getApp()    }  });# template.jadeul    each l in list        li=l.valueQuestionsSome advice about node code. How can I make it more idiomatic and beautiful?There is some strange behavior in the node app. Benchmark results proposed below should describe it. What I'm doing wrong?I would be glad to achieve any piece of advice about improving these code samples.Running 30s test @ http://localhost:3000/102 threads and 64 connections  Thread Stats   Avg      Stdev     Max   +/- Stdev    Latency    26.19s     4.89s   28.93s    77.14%    Req/Sec     0.87      1.46     4.00     86.67%  64 requests in 30.01s, 81.25KB read  Socket errors: connect 0, read 0, write 0, timeout 896
Simple web application for benchmark
javascript;python;node.js;express.js;flask