API Called in Inner Program Loop
A potential American customer ordered a free GiAPA X-Ray because of performance problems with a job. The actual problem was solved, but it drew much more attention that GiAPA, automatically analyzing all jobs, highlighted another job because 94 % of the run time (over 3½ hours CPU) was used on function QDBSIZFI within the QUSROBJD API. The need for requesting file size information hundreds of times per second seemed unlikely, and was of course a mistake - the RTVOBJD CL command calling the API was placed within the inner loop of the program instead of outside.
The result was a typical GIAPA win-win situation: We got a new customer, and the customer had ROI already from the first GiAPA analysis. The needed change of program source code was easy and took only a few minutes, which is quite normal when optimizing performance, because it is never the complex business logic of the application that must be modified.
GiAPA reported 1,719 calls of "Retrieve Object Description" in code line 9 of program J6BQJXN, and using F1 gave the optimization tips displayed in the bottom of the screen. The call stack pie chart showed that almost all the run time was used on just one utility function - indeed not a normal picture.