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 = ​%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. 


Ayesha Wee

    Blogger Comment
    Facebook Comment


Post a comment