Perforce JViews TGO Sample: Table Component - Custom Classes Performance
Description
This sample shows the performance of a Perforce JViews TGO table 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,
table-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 scroll.
- 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 table 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 table component is connected to it. You can modify this behavior by changing thefillDataSourceFirst
Boolean attribute.
By default, 10000 objects are created in the data source. You can modify this number by changing thenumberOfRows
integer attribute. -
Time to get a first display.
The classDisplayTest
is used to measure the time of the first display, that is, the time between the end of the data source filling and the display of the rows. -
Total time from the start of the sample to the end of the display.
This time is computed in theDisplayTest
class. -
Time to scroll.
The classScrollTest
is used to measure the time to scroll a number of rows, one by one.
By default, the number of rows is 500. You can modify this number by changing thenumberOfScrolledRows
integer attribute. -
Time to update an attribute in all the objects and display the results.
The acknowledge attribute of each object is changed - Time to clear the data source and display the results.
Installation Directory
The Table 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.IlpTable
The table component.
Source Files
-
customClassesPerformance.Main
The entry point of the sample.