【发布时间】:2016-10-19 14:55:25
【问题描述】:
我需要从预定义的模板中准备消息,我们要构建的系统将在一秒钟内准备 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 模板的看法。使用它有什么缺点吗?
【问题讨论】:
-
如果您对快速模板扩展感兴趣,请查看 Arco:它基于 JSP,并在编译时将模板编译为 Java。 arco.samajackun.com/arco-maven-plugin/faq.html
标签: java mustache template-engine rythm pebble