We're developing a Java web app that utilizes JSF (Richfaces through Seam) for its UI. I've read several articles that indicate that using the "rendered=" attribute on UI components results in a pretty substantial performance hit. We have several components that we'd like to enable or disable based on whether or not their values are set. For example, if we're displaying an item for sale we wouldn't have a bunch of blank fields for attributes that are not set.
Given this performance hit, however, we're apprehensive about using multiple "rendered" fields. Is there a better performing alternative to this? Is there anything we can do to improve the performance of using this field?
If the getter does nothing else than just returning a (cached) boolean property, then I really don't see any pains. There's no alternative to it. Best what you could to to improve the performance is to cache it in either the model (lazy loading) or the view (c:set
). The cost of getter method invocation in turn is fully negligible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With