Keystone-classic: perfromance vs vanilla express

Created on 21 Jul 2016  路  6Comments  路  Source: keystonejs/keystone-classic

Is there a reason why a simple GET route in keystonejs takes ~ 5-6x as long compared to plain express?

clean/empty install of keystonejs.

The route in question:

app.get('/hello/:name', function(req, res){
  res.send('hello ' + req.params.name);
});

The numbers:

Document Path:          /hello/abcdef
Document Length:        12 bytes
Concurrency Level:      100
Time taken for tests:   16.017 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      2580000 bytes
HTML transferred:       120000 bytes
Requests per second:    624.35 [#/sec] (mean)
Time per request:       160.168 [ms] (mean)
Time per request:       1.602 [ms] (mean, across all concurrent requests)
Transfer rate:          157.31 [Kbytes/sec] received

vs

Document Path:          /hello/abcdef
Document Length:        12 bytes
Concurrency Level:      100
Time taken for tests:   2.915 seconds
Complete requests:      10000
Failed requests:        0
Total transferred:      2060000 bytes
HTML transferred:       120000 bytes
Requests per second:    3430.19 [#/sec] (mean)
Time per request:       29.153 [ms] (mean)
Time per request:       0.292 [ms] (mean, across all concurrent requests)
Transfer rate:          690.06 [Kbytes/sec] received
needs input

Most helpful comment

want flamegraphs :0

All 6 comments

It must be due to one of the express middlewares we add, it would be good to profile the server while doing this test. With Node v6.3.0 you can add the --inspect flag to the command line to have a Chrome Devtools available for debugging, and it has a profiler.

Could you give it a shot?

want flamegraphs :0

hmm...

I'm on v6.2.2, however with node-inspector enabled - the response is great:

Document Path:          /hello/abcdef
Document Length:        25 bytes
Concurrency Level:      100
Time taken for tests:   2.608 seconds
Complete requests:      10000
Failed requests:        0
Non-2xx responses:      10000
Total transferred:      2230000 bytes
HTML transferred:       250000 bytes
Requests per second:    3834.05 [#/sec] (mean)
Time per request:       26.082 [ms] (mean)
Time per request:       0.261 [ms] (mean, across all concurrent requests)
Transfer rate:          834.95 [Kbytes/sec] received

never mind - just saw that these were Non-2xx responses

Is your express setup like-for-like? if there's a session we'll hit the database to load the user, for example, and there's body / cookie parsers, etc.

Also can you confirm whether you're benchmarking 0.3.x or 0.4 / master? the express structure has changed quite a bit.

If you can identify the slow points, that would be fantastic :)

Closing as old issue, and @afrozl seemed to have been okay with this. Any performance concerns should go as a new issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

koenoe picture koenoe  路  4Comments

kamontat picture kamontat  路  5Comments

stennie picture stennie  路  5Comments

Twansparant picture Twansparant  路  5Comments

jacqueslareau picture jacqueslareau  路  5Comments