Understanding DMS metrics and Characteristics

Oracle Application Development Framework Performance Tuning 8-3

8.2.2 Performance Considerations for ADF Faces

Table 8–2 provides configuration recommendations that may improve performance of ADF Faces: Note: When you are profiling or measuring client response time using the Firefox browser, ensure that the Firebug plug-in is disabled. While this plug-in is very useful for getting information about the page and for debugging JavaScript code on the page, it can impact the total response time. For more information on disabling the Firefox Firebug plug-in, see the Firefox Support Home Page at http:support.mozilla.comen-USkb . 8-4 Oracle Fusion Middleware Performance and Tuning Guide Table 8–2 Configuration Parameters for ADF Faces Configuration Recommendation Description Use partial page navigation. Partial Page Navigation is a feature of the ADF Faces framework that enables navigating from one ADF Faces page to another without a full page transition in the browser.The new page is sent to the client using Partial Page Rendering PPRAjax channel. The main advantage of partial page navigation over traditional full page navigation is improved performance: the browser no longer re-interprets and re-executes Javascript libraries, and does not spend time for cleanupinitialization of the full page. The performance benefit from this optimization is very big; it should be enabled whenever possible. Some known limitations of this feature are: ■ For the documents metaContainer facet the HEAD section, only scripts are brought over with the new page. Any other content, such as icon links or style rules can be ignored. ■ Applications cannot use anchor hash URLs for their own purposes. Use page templates. Page templates enable developers to build reusable, data-bound templates that can be used as a shell for any page. A developer can build one or more templates that provide structure and consistency for other developers building web pages. The templates have both static areas on them that cannot be changed when they are used and dynamic areas on them where the developer can place content specific to the page they are building. There are some important considerations when using templates: ■ Since templates are present in every application page, they have to be optimized so that common performance impacts are avoided. Adding round corners to the template, for example, can impact the performance for every page. ■ When building complex templates, sometimes it is easier to build them in multiple pieces and include them in the top-level template using f:subview tag. However, from a performance perspective, this is not typically recommended since it can impact memory usage on the server side. f:subview introduces another level into the ID scoping hierarchy, which results in longer IDs. Long IDs have a negative impact on performance. Developers are advised to avoid using f:subview unless it is required. It is not necessary to use f:subview around jsp:include if you can ensure that all IDs are unique. For example, if you are using jsp:include, break a large page into multiple pieces for easier editing. And whenever possible, avoid using f:subview. If you are including content developed by someone else, use f:subview if you do not know which IDs the developer used. In addition, you do not have to put f:subview at the top of a region definition. ■ Avoid long IDs in all cases, especially on pageTemplates, subviews, subforms, and on tables or within tables. Long IDs can have a performance impact on the server side, network traffic, and client processing. Oracle Application Development Framework Performance Tuning 8-5 Enable ADF rich client geometry management. ADF Rich Client supports geometry management of the browser layout where parent components are in the UI explicitly. The children components are sized to stretch and fill up available space in the browser. While this feature makes the UI look better, it has a cost. The impact is on the client side where the browser must spend time resizing the components. The components that have geometry management by default are: PanelAccordion PanelStretchLayout PanelTabbed BreadCrumbs NavigationPane PanelSplitter Toolbar Toolbox Table Train Notes: ■ When using geometry management, try minimizing the number of child components that are under a parent geometry managed component. ■ The cost of geometry management is directly related to the complexity of child components. ■ The performance cost of geometry management can be smaller as perceived by the user for the pages with table or other data stamped components when table data streaming is used. The client-side geometry management can be executed while the browser is waiting for the data response from the server. Use the ADF rich client overflow feature. ADF Rich Client supports overflow feature. This feature moves the child components to the non-visible overflow area if they cannot fit the page. The components that have built-in support for overflow are: PanelTabbed, BreadCrumbs, NavigationPane, PanelAccordion, Toolbar, and Train. Toolbar should be contained in a Toolbox to handle the overflow. While there were several optimizations done to reduce the cost of overflow, it is necessary to pay special attention to the number of child components and complexity of each of them in the overflow component. Sometimes it is a good practice to set a big enough initial size of the overflow component such that overflow does not happen in most cases. Table 8–2 Cont. Configuration Parameters for ADF Faces Configuration Recommendation Description 8-6 Oracle Fusion Middleware Performance and Tuning Guide Use ADF Rich Client Partial Page Rendering PPR. ADF Rich Client is based on Asynchronous JavaScript and XML Ajax development technique. Ajax is a web development technique for creating interactive web applications, where web pages feel more responsive by exchanging small amounts of data with the server behind the scenes, without the whole web page being reloaded. The effect is to improve a web pages interactivity, speed, and usability. With ADF Faces, the feature that delivers the Ajax partial page refresh behavior is called partial page rendering PPR. PPR enables small areas of a page to be refreshed without having to redraw the entire page. For example, an output component can display what a user has chosen or entered in an input component or a command link or button can cause another component on the page to be refreshed. Two main Ajax patterns are implemented with partial page rendering PPR: ■ native component refresh ■ cross-component refresh While the framework builds in native component refresh, cross-component refresh has to be done by developers in certain cases. Cross-component refresh is implemented declaratively or programmatically by the application developer defining which components are to trigger a partial update and which other components are to act as partial listeners, and so be updated. Using cross-component refresh and implementing it correctly is one of the best ways to improve client-side response time. While designing the UI page always think about what should happen when the use clicks a command button. Is it needed for the whole page to be refreshed or just an output text field? What should happen if the value in some field is updated? For more information, refer to Oracle Fusion Middleware Fusion Developers Guide for Oracle Application Development Framework. Consider a typical situation in which a page includes an af:inputText component, an af:commandButton component, and an af:outputText component. When the user enters a value for the af:inputText, then clicks the af:commandButton, the input value is reflected in the af:outputText. Without PPR, clicking the af:commandButton triggers a full-page refresh. Using PPR, you can limit the scale of the refresh to only those components you want to refresh, in this case the af:outputText component. To achieve this, you would do two things: ■ Set up the af:commandButton for partial submit by setting the partialSubmit attribute to true. Doing this causes the command component to start firing partial page requests each time it is clicked. ■ Define which components are to be refreshed when the partial submit takes place, in this example the af:outputText component, by setting the partialTriggers attribute for each of them to the id of the component triggering the refresh. In this example, this means setting the partialTriggers attribute of the af:outputText component to give the id of the af:commandButton component. The steps above achieve PPR using a command button to trigger the partial page refresh. The main reason why partial page rendering can significantly boost the performance is that full page refresh does not happen and the framework artifacts such as ADF Rich Client JS library, and style sheets are not reloaded and only a small part of page is refreshed. In several cases, this means no extra data is fetched or no geometry management. The ADF Rich Client has shown that partial page rendering results in the best client-side performance. Besides the impact on the client side, server-side processing can be faster and can have better server-side throughput and scalability. Table 8–2 Cont. Configuration Parameters for ADF Faces Configuration Recommendation Description