1

i'm trying to optimize my nodejs app, i try to keep track of long synchronous CPU intensive

I wonder what is indicating the elapsed time in the console because it's much slower when i use jade renderer than strait out JSON.

res.json(account);
// GET /api/accounts/2 200 2ms - 1.06kb
res.render('template/profile', account);
// GET /template/profile/accounts/2 200 17ms - 3.41kb

What is this time exactly saying ? is it how long the request blocked nodejs, or just the time between request and answer ?

Is their a way to speed up jade rendering ?

kigiri
  • 2,952
  • 21
  • 23

1 Answers1

1

It is the time between receiving the the request and sending the response.

There are possible optimizations you can do to speed up your jade rendering, although with a response time of 17ms i wouldn't bother too much as it seems pretty fast to me.

Have a look at this answer https://stackoverflow.com/a/11496291/532102 where the author suggests looking at different more performant templating engines. Usually there are other factors that play a more important role for express performance such as caching and optimizing database queries.

Community
  • 1
  • 1
tmaximini
  • 8,403
  • 6
  • 47
  • 69