Template framework benchmark

895 Views Asked by At

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. So i have written a program to build 1000 messages sequentially with multiple template framework available in the market which are

   -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.

To prepare 1000 messages sequentially. 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.

Let me know your thoughts on Rythm template. Is there any drawback on using it.

2

There are 2 best solutions below

1
suresh On

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?

2
Gelin Luo On

Hey Author of Rythm here. Thanks for putting Rythm into your benchmark list.

My understand about Rythm:

The good thing about Rythm is usability, feature set and expressiveness.

The drawback might be:

  1. The jar is a bit fat
  2. There is no IDE integration except vim