C++ component performance  Chapter 4: EJB CMP Tuning

Chapter 3: Component Tuning

PowerBuilder component performance

PowerBuilder version 8.0.3, in tandem with EAServer changes introduced in version 4.1.3, introduces many performance improvements such as improved memory management, reduced virtual address space, and less system resource use by DataStore objects. For details on which PowerBuilder versions Sybase recommends for EAServer on your platform, see the EAServer Release Bulletin for your platform. In addition, you can tune the following settings for improved performance.

Settings that affect system resource use

The system resource use of your PowerBuilder components determines how many instances can run on a given system, which in turn determines how many simultaneous clients the application can serve. Tune the settings in Table 3-4 to minimize resource use.

Table 3-4: PowerBuilder component settings that affect resource use



Component class loader

By default, the PBVM uses per-component class loaders to run components. You can configure components to share class loaders to reduce the memory footprint required to run components. Doing so can improve scalability by allowing more component instances to run in the available memory. For details, see the Sybase white paper Reducing Memory Requirements When Using PowerBuilder Components in EAServer.

DataStore resource footprint

DataStore objects used in components can consume system resources such as memory and Windows user and kernel object handles. When many DataStore objects are instantiated, they can exhaust the available resources unless you have tuned the DataStore settings to minimize resource use. For details on tuning DataStore settings, see the Sybase white paper Operating System Constraints Affecting the Scalability of PowerBuilder DataStores in EAServer.

DataWindow memory management

For large retrievals or imports into a DataWindow object, set the datawindow.storagepagesize property to LARGE. Setting this property allows the DataWindow to most efficiently use the available virtual memory. While the setting LARGE is recommended, a setting of MEDIUM is also available. For more information, see the DataWindow Reference manual in the PowerBuilder documentation.

Bind thread

Disable Bind Thread for PowerBuilder components deployed to EAServer unless you are using a Windows deployment with a PBVM version lower than 8.0.3 and you declare a DataStore as an instance or global variable. Bind Thread is not required in UNIX deployments, Windows deployments with PBVM 8.0.3 or later, or in earlier-version Windows deployments where you only use local variables for DataStore references.

If the Bind Thread property is set to true when you deploy, be sure that the component is in the BindThread instance pool. This is the default pool for components with Bind Thread enabled unless you override the setting.

For more information on threading issues that affect PowerBuilder components, see the Application Techniques manual in the PowerBuilder documentation.

NoteThe Bind Thread property must be set to TRUE in the PowerBuilder IDE if you are using live editing to build your component. Remember to change it to FALSE when deploying your components for production use.

Garbage collection

The PBVM uses a garbage collection model to free memory used by unreferenced and orphaned objects. A garbage collector thread runs periodically to perform this task. You can call the GarbageCollect() PowerScript® function to force garbage collection to occur immediately. Doing so may increase the performance of applications that use huge amounts of memory. For details on how to code components to force garbage collection, see the Sybase white paper Forcing the Garbage Collection Process in PowerBuilder 6.0/7.0/8.0.

For more information on how garbage collection happens in PowerBuilder, see the Application Techniques manual in the PowerBuilder documentation.

DataStore row height size

If you are retrieving a lot of rows of data, try setting the datawindow.detail.height.autosize property for the DataStore object to false. Depending on the number of rows being retrieved, this setting can have a significant impact on performance. If you have autosize enabled for the height or width of any specific objects, try disabling those settings as well. For more information, see the DataWindow Reference manual in the PowerBuilder documentation.

Web DataWindow settings

If you use Web DataWindows, tuning these settings can improve performance.

Tuning code generation settings You can tune the Web DataWindow settings to minimize the size of the generated JavaScript code. Doing so improves the client response time by avoiding the generation and network transport of unneeded code. If you do not use a feature such as display formatting, validation rules, or client-side scripting, disable code generation for the unused feature. You can also cache client-side methods in JavaScript files to reduce the size of the generated code and increase performance on both the server and the client. Without JavaScript caching, each time a Web DataWindow is rendered in a client browser, JavaScript code for DataWindow methods is generated on the server and downloaded to the client. However, there is no performance gain if the client Web browser settings prevent caching. The DataWindow Programmer’s Guide in the PowerBuilder documentation describes techniques for controlling the size of generated code.

Using custom containers For improved performance, use a custom component as the Web DataWindow container rather than the predefined HTMLGenerator component. When using a custom component, you can configure additional settings to reduce the number of method calls required to configure the component. Doing so can result in improved performance, maintainability, and scalability. Specifically, you can set the source file and DataWindow object on the server so that the DataWindow object is loaded when the component instance is created, resulting in fewer method calls from server-side scripts in the Web page. You can also improve performance by having your custom component maintain its state. For more information, see the DataWindow Programmer’s Guide in the PowerBuilder documentation.

Changing the Web target default behavior By default, the PSJaguarConnection methods for using a Web DataWindow make several trips to the server. You can set the bOneTrip argument to make one trip to the server instead. Doing so improves performance by reducing network traffic. For more information, see the PSJaguarConnection reference pages in the Web and JSP Target Reference manual in the PowerBuilder documentation.

Copyright © 2005. Sybase Inc. All rights reserved. Chapter 4: EJB CMP Tuning