Perforce JViews TGO Sample: Tree Component - Custom Classes Performance
Description
This sample shows the performance of a Perforce JViews TGO tree component that uses custom classes.
How to Use the Sample
How to Run the Sample as an Application
This sample can
be run as an application.
The installation directory contains
an executable JAR file,
tree-customClassesPerformance.jar
,
that allows you to execute the sample with a double click from a
file browser. Note that if you are using Internet Explorer, you can
open the installation directory
and execute the JAR file from the browser. This
technique may not work in other Web browsers.
Alternatively, you
can run the sample application from the command line.
First check that the Ant utility is properly configured. If not, see the
instructions on how to configure Ant for Perforce JViews.
Then, go to the installation directory
of the sample and type:
ant run
Topics Covered
- Time to fill the data source
- Time to get a first display
- Total time from the start of the sample to the end of the display
- Time to expand the first node
- Time to update an attribute in all the objects and display the results
- Time to clear the data source and display the results
Detailed Description
This sample measures the performance of a JTGO tree component that displays custom classes. The specific code of this sample is in the benchIt method of customClassesPerformance.Main. It contains the following steps:
- Time to fill the data source.
The data source is filled in thefillDataSource
method. By default, the data source is populated before the tree component is connected to it. You can modify this behavior by changing thefillDataSourceFirst
Boolean attribute.
By default, 20 root objects with 500 children each are created in the data source. You can modify these numbers by changing thenumberOfParents
andnumberOfChildren
integer attributes. - Time to get a first display.
The classDisplayTest
is used to measure the time of the first display. This time is the time between the end of the data source filling and the display of the root objects. - Total time from the start of the sample to the end of the display.
This time is computed in theDisplayTest
class. - Time to expand the first object.
The classExpandTest
is used to measure the time to expand the first object. - Time to update an attribute in all the objects and display the results.
An alarm is set to each object. - Time to clear the data source and display the results.
Installation Directory
The Tree Component - Custom Classes Performance sample is installed here.
Classes Involved
-
ilog.tgo.IltSystem
The class that initializes a JViews TGO application.
-
ilog.tgo.datasource.IltDefaultDataSource
The default datasource implementation.
-
ilog.cpl.IlpTree
The tree component.
Source Files
-
customClassesPerformance.Main
The entry point of the sample.