What steps can be taken to improve jade template rendering performance in express using nodejs

前端 未结 3 1579
我寻月下人不归
我寻月下人不归 2021-02-13 05:27

Background

jade syntax is awesome but i wanted to see how it was affecting performance.

So i created a single page app and used apache bench to compare its throu

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-13 05:54

    As mentioned by Harry, it's meaningless to compare a template engine's performance to the performance of sending a string, since those address two different needs. It's somewhat like comparing the MPG of two cars, except one car you just put into neutral and let it roll down a hill.

    Instead, it is much more helpful to compare templating engines, since they are all means to the same ends (dynamically rendered HTML).

    Here we see that Jade is the slowest templating language. There are probably a lot of factors that play in to why this is the case, but the core issue is that Jade wasn't designed for speed. If you need extremely high performance, doT was designed for speed.

提交回复
热议问题