Showing posts with label %PerfTime. Show all posts
Showing posts with label %PerfTime. Show all posts

How to Reduce Trips to the Application Server in PeopleSoft

How to Reduce Trips to the Application Server in PeopleSoft
Too many server trips will reduce you PeopleSoft Application performance. The main reason is each server trip consumes resources on the application server and it takes time to assemble the component buffer that stores the data being processed. each server request generates the HTML for the pages to be redisplayed, updated the component buffer and storing the buffer on the web server. To increase your PeopleSoft application performance you may want to reduce the server trips.
The following user interactions cause a trip to the server. Only the first three items in the list are deferred in deferred processing mode.

  • Entering data in fields with FieldEdit or FieldChange PeopleCode.
  • Entering data in fields that have prompt table edits.
  • Entering data in fields that have related displays.
  • Inserting a row in a grid or scroll area.
  • Deleting a row from a grid or scroll area.
  • Using grid or scroll area controls to move forward or back.
  • Accessing another page in the component.
  • Selecting an internal tab.
  • Expanding or collapsing a collapsible section.
  • Clicking a button or link.

How to count Server trips


Count the trips to the server to quickly identify transactions that have performance issues. PeopleTools can automatically count these trips by reason (such as, adding a row in a grid or FieldChange PeopleCode) and write the output to a log file.
To turn this feature on, run a debug version of PeopleTools and add the following to the [trace] section of the appserv.cfg file:
showcounters = 1
The output is written to the appsrv.log file.

Use Deferred Mode

You can selectively made interactive mode enabled (i.e. Deferred Mode disabled) for individual fields on a page if you need a action to be triggered in your field immediately (such as FieldChange). obviously This will depend on your users requirements. If you unnecessarily made Deferred Mode disabled on a page or a component then it carry extra trips to the server hence it may reduce your application response time.

Hide, Unhide, Enable and Disable Fields 

As a general rule use Page Activate PeopleCode or for objects that are on another page in the component, in FieldChange PeopleCode to hide or unhide objects and enable or disable objects.
You can hide or unhide objects or set them to display-only in page Activate PeopleCode before the page initially appears based on setup data, configuration options, or personalization settings. You can set fields to display-only using PeopleCode by setting the DisplayOnly property for the field to True.

Using the Refresh Button

Clicking the Refresh button forces a trip to the server. PeopleTools then redisplays the page in the browser. The refresh action allows the user to:
  • See related display field values for the data entered so far
  • See any default values based on data entered previously on the page.
  • Validate the data that has been entered on the page so far.
When the page is redisplayed, the cursor is positioned in the same field it was when the user pressed the Refresh button.

Using Warning Messages

In deferred mode, for FieldEdit PeopleCode errors and warnings do not appear when a user moves out of the field, but rather on the next trip to the server.
Unlike FieldEdit error messages, for warning messages PeopleTools does not change field to red or position the cursor to the field when it displays the message. For a user to clearly understand to which field a warning message applies, ensure that warning messages clearly describe the fields affected by the warning

Using Optimised Algorithm

In the previous post http://peoplesoftdotnet.blogspot.com.au/2015/04/time-taken-to-execute-peoplecode.html I explained how to use %PerfTime system variable for determining elapsed time for your PeopleCode programming constructs. That way you can optimise the logic of your PeopleCode program.

How to determine the time taken to execute your PeopleCode program

Sometime you may have noticed that your PeopleSoft application takes long time to execute and you might get tired of looking at the spinning wheel and thinking of what is going on behind the scenes. This type of performance issues will arise due to many reasons. One reason may be your PeopleCode program logic is not optimised enough so that it takes long time to execute. If you can determine how much time (in other terms algorithmic efficiency) taken to execute your particular program then most probably you can improve you code so that it will reduce processing time of your PeopleCode program. Lets have a look how you can achieve this.
  • You can use the %PerfTime system variable for determining elapsed time. %PerfTime retrieves the local system clock time (of the application server) by making a system call, and the return time is down to the millisecond. Look at the following simple example where you can determine time taken for the particular PeopleCode program segment.
&Start = ​%PerfTime;
   &results = "";
   For &I = 1 To &Count;
      &GnnwgNumber = GetNextNumberWithGapsCommit(QEORDER_DTL.QE_QTY, 999999, 1,⇒
 "where QE_ORDER_NBR='GNNWG'");
      &results = &results | " : " | &GnnwgNumber;
   End-For;
   
   &End = ​%PerfTime;
   &out = "Count = " | &Count | ", total GNNWG time (s) = " | NumberToString⇒
("%6.3", Value(&End - &Start));

PeopleSoft recommends using %PerfTime when measuring performance time for a specific PeopleCode program. This can enable developers to evaluate which coding logic has better performance time.

  • Another option is you can run PeopleSoft SignOn Trace. To get the SignOn tracing options (the signon URL includes the trace directive) In the address bar you can type "http://server:port/psp/ps/?cmd=login&trace=Y". This will show you a page like this. From this page you can specify PeopleCode trace settings. Select Each Statement from Peoplecode Trace Setting and get the trace file generated on your app server. In this trace file you can get the timestamp for each statement in the PeopleCode.