PrimeFaces渲染属性对性能的影响 [英] PrimeFaces rendered attribute impact on performance

查看:58
本文介绍了PrimeFaces渲染属性对性能的影响的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在用PrimeFaces开发一个JSF应用程序,我打算在其中主要使用tabViews(多个).为了让您大致了解应用程序的工作方式,我有一个侧面菜单,用户可以从中选择模块",这些模块将在中心布局中显示为选项卡".鉴于我有多个模块",并且将来还会有更多模块,因此我决定使用的解决方案是为xhtml中具有的所有选项卡编写代码,然后使用rendered属性(默认设置为false )以显示它们(当用户单击相应菜单时).

现在,我的问题是,是否将组件的rendered属性设置为false,等同于该组件根本不存在(对性能完全没有影响)?


I'm developing a JSF application with PrimeFaces in which i plan to use mainly tabViews (multiple ones). To give you a general idea about how the application is going to work, I have a side menu from which the user should be able to choose "modules" that will display in the center layout as Tabs. Seeing as I have multiple "modules" and there will be more in the future, the solution I've decided on using is writing the code for all the tabs I have in the xhtml and then using the rendered attribute (set to false by default) in order to display them (when the user clicks on the corresponding menu).

Now comes my question, is setting a component's rendered attribute to false equivalent to that component not being there at all (no impact at performance at all)?

推荐答案

现在我要问的问题是,是否将组件的rendered属性设置为false等效于该组件根本不存在(对性能完全没有影响)?

Now comes my question, is setting a component's rendered attribute to false equivalent to that component not being there at all (no impact at performance at all)?

这不是等效的.如果您设置了rendered = false,则该组件仍在服务器端的组件树中.因此,它需要一点性能和内存.

It's NOT equivalent. If you set rendered=false, the component is still there in the component tree on the server side. Therefor it costs a little bit performance and memory.

过去,当组件树变大时,Mojarra也遇到了很大的性能问题: https://blog.oio.de/2013/05/16/jsf-performance-mojarra-improves-dramatically-with-latest-release/

Mojarra also had big performance problems in the past when the component tree is bigger: https://blog.oio.de/2013/05/16/jsf-performance-mojarra-improves-dramatically-with-latest-release/

这篇关于PrimeFaces渲染属性对性能的影响的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆