jreijn / spring-comparing-template-engines

Demo project to show different Java templating engines in combination with Spring MVC
Apache License 2.0
422 stars 116 forks source link

Issue #6 - added jtwig to the project #12

Closed Vest closed 8 years ago

Vest commented 8 years ago

Hello @jreijn,

I have added jtwig into your project, so you can review and close the issue #6. Could you please take a look at my code? I tried to use some features from the framework, so people can get a feeling how it works. Could you please measure the performance on your 5-years old PC and update the results?

Thanks, Vest

jreijn commented 8 years ago

I actuall redid the benchmark on my modern i7 macbook and the results have been processed in the readme of the project.

Vest commented 8 years ago

Regarding the benchmark, I meant that if possible, could you please test jtwig on your PC? README.md doesn't have the comparison of jtwig with other frameworks.

jreijn commented 8 years ago

You are right. Currently working on that. Twig seems really slow compared to other frameworks. Even with caching enabled. I'll see what I can find before I add the results.

Vest commented 8 years ago

I tried to use the multithreading (jtwig supports "concurrent" rendering), but it didn't work well for my simple example. As I said, three files can be combined to a single one (probably this will improve the performance), but I think this project demonstrates a very draft performance comparison. Otherwise everybody will use raw-servlets :) Thanks again.

jreijn commented 8 years ago

I've figured out it had to to with the use of layouts. I've seen this before with scalate. In case a layout mechanism is used the tremendously slows down the performance. Using just includes is much better. Difference between 25 seconds and 5 seconds. I'll change the code a little and update later tonight.

Vest commented 8 years ago

Thank you for the fix. I didn't want to disturb you much. Did I understand correctly that this template engine works inefficient with page inheritance, but works well with simple includes?