开发者

Struts 2 OGNL s:iterator vs JSTL c:forEach performance

开发者 https://www.devze.com 2023-04-04 18:50 出处:网络
I\'ve been building some fairly dynamic web applications recently that rely heavily on database(JPA) backed configurations. These applications are multi-user, multi-account systems in which the end us

I've been building some fairly dynamic web applications recently that rely heavily on database(JPA) backed configurations. These applications are multi-user, multi-account systems in which the end users can create custom forms based on JPA entities.

I noticed as my JSP pages became more complex that my performance and load times were taking a hit. Originally I had thought it was the data layer causing my bottleneck, but on a whim today I replaced a couple include pages which are created on the fly using lists of objects that are iterated over by struts with a JSTL based iteration scheme. I was blown away that my page lo开发者_StackOverflow中文版ad time went from about 10 seconds to around a second. The render times of the JSP pages increase substantially (with struts2 OGNL iteration) as the list sizes grow.

In my struts configs I have dev mode turned off and I'm using a simple theme set, nothing special. I'm considering rewriting some of my iteration heavy pages to use JSTL instead of struts, but I thought I would ask around to see if I'm missing something or if anyone has run into similar circumstances.


OGNL is pretty slow; newer versions will be looking to make some performance enhancements.

IMO where S2 and JSTL tag functionality overlap, as with S1, I lean towards JSTL.

Without knowing more about your actual presentation layer, what measures you've taken to increase performance already, or more details about what your theme templates look like, it's tough to say more.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号