简体   繁体   English

模板框架基准

[英]Template framework benchmark

I have a requirement to prepare message from the predefined template, System which we are going to build will prepare 100 messages in a second. 我需要从预定义的模板中准备消息,我们将要构建的系统将在一秒钟内准备100条消息。 So i have written a program to build 1000 messages sequentially with multiple template framework available in the market which are 所以我写了一个程序,用市场上可用的多个模板框架依次构建1000条消息

   -String template
   -Mustache template
   -Thymeleaf template
   -Rythm template
   -Pebble template
   -handler template

Template which i have used for this performance test contains some logic with multiple if/else , for and substitution statements. 我用于此性能测试的模板包含一些逻辑,其中包含多个if / else,for和替换语句。

To prepare 1000 messages sequentially. 依次准备1000条消息。 Endresult of these are listed below 这些的结果如下

  String template - 40 seconds
  Mustache template - 2 seconds
  Thymeleaf template - 15 seconds
  Rythm template   - 2 seconds
  Pebble template - 4 seconds
  Handler template - 7 seconds

In these i believe Rythm template beaten all other template framework. 在这些方面,我相信Rythm模板击败了所有其他模板框架。

Let me know your thoughts on Rythm template. 让我知道您对节奏模板的想法。 Is there any drawback on using it. 使用它有什么缺点吗?

Hey Author of Rythm here. 嘿,节奏的作者。 Thanks for putting Rythm into your benchmark list. 感谢您将Rythm放入基准列表。

My understand about Rythm: 我对节奏的理解:

The good thing about Rythm is usability, feature set and expressiveness. Rythm的优点是可用性,功能集和表现力。

The drawback might be: 缺点可能是:

  1. The jar is a bit fat 罐子有点胖
  2. There is no IDE integration except vim 除了vim之外没有IDE集成

One drawback i have seen is if there are any customized/userdefined function which can be used in multiple template then we need to write the same function in all templates. 我看到的一个缺点是,如果可以在多个模板中使用任何自定义/用户定义的函数,那么我们需要在所有模板中编写相同的函数。 Is that my understanding right? 我的理解对吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM