performance - Why Play! framework chose Groovy for template engine -
from website http://www.playframework.org/documentation/1.0/faq
" biggest cpu consumer in play stack @ time template engine based on groovy. play applications scalable, not problem if need serve high traffic: can balance load between several servers. , hope performance gain @ level new jdk7 , better support of dynamic languages. "
so there no better choices? jsp?
jsp not feasible every jsp compiles servlet , servlet api provides things server side session not compatible restful paradigm. don't want go dark ages of badly scalable server side sessions, buttoning problems in browser, reposts etc.
japid templates interesting, not backed great community , perhaps didn't exist @ time play created (i don't know sure though). tried japid replacement groovy templates in own application , found out in jmeter test benefit marginal, 10% max. 25% improvement.
i guess in end depends on scalability requirements , structure of pages. picked 90% use case of application , did test. me, little improvement did not justify additional costs of dependency (i keep dependencies minimum maintainability).
groovy templates not bad or slow in general. use typed variables wherever possible (instead of "def"), in closures! keep values of accessed properties in local variables. reasonable results paging. keep fingers crossed gsp might able run on groovy++ in future , you're done ;)
to me, question not why used groovy in views. is, because rather miss in controller layer. groovy make coding controller behaviour lot easier imho.
Comments
Post a Comment