我有一个从预定义模板准备消息的要求,我们要建立的系统将在一秒钟内准备100条消息。所以我写了一个程序,用市场上的多个模板框架顺序构建1000条消息,这些模板框架是
-String template
-Mustache template
-Thymeleaf template
-Rythm template
-Pebble template
-handler template我在这个性能测试中使用的模板包含一些带有多个if/else、for和替换语句的逻辑。
按顺序准备1000条消息。它们的最终结果如下所示
String template - 40 seconds
Mustache template - 2 seconds
Thymeleaf template - 15 seconds
Rythm template - 2 seconds
Pebble template - 4 seconds
Handler template - 7 seconds在这些方面,我相信Rythm模板击败了所有其他模板框架。
让我知道你对Rythm模板的想法。使用它有什么缺点吗?
发布于 2016-10-20 04:23:34
嗨,Rythm的作者在这里。感谢您将Rythm添加到您的基准测试列表中。
我对Rythm的理解:
Rythm的优点是可用性、特性集和表现力。
缺点可能是:
之外,没有集成开发环境
发布于 2016-10-19 22:55:25
我看到的一个缺点是,如果有任何自定义/用户定义的函数,可以在多个模板中使用,那么我们需要在所有模板中编写相同的函数。我的理解对吗?
https://stackoverflow.com/questions/40134957
复制相似问题