RDML Code benchmarking

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
sotis
Posts: 16
Joined: Thu Sep 16, 2021 11:37 pm

RDML Code benchmarking

Post by sotis »

Hello,

is it possible somehow to benchmark my RDML code to find out if a code optimization worked?

eg. the following pseudocode when GetTicks gives the time, say in millisecond accuracy.

GetTicks1
Execute Code
GetTicks2

DIFF = GetTick2 - GetTicks1
Display(#DIFF)

best,
Sotiris
User avatar
Dino
Posts: 472
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: RDML Code benchmarking

Post by Dino »

depending on how small or large, you could just use the time as seconds.

Code: Select all

Define Field(#starttime) Reffld(#timex)
Define Field(#endtime) Reffld(#timex)
Define Field(#diff) Type(*DEC) Length(15) Decimals(0)

#starttime := #timex.Now

Begin_Loop To(10000)
Select Fields(*ALL) From_File(pslmst)
Endselect
End_Loop

#endtime := #timex.Now
#diff := #endtime.AsSeconds - #starttime.AsSeconds
other post about date difference here:
viewtopic.php?f=3&t=2652&p=7898&hilit=d ... ence#p7898

notice that datetimex can have miliseconds, but then you have to make the routine for the difference of those. I think the current routine is in seconds.
User avatar
Dino
Posts: 472
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: RDML Code benchmarking

Post by Dino »

This can give you difference in miliseconds:

Code: Select all

Define Field(#starttime) Reffld(#datetimex)
Define Field(#endtime) Reffld(#datetimex)
Define Field(#diff) Type(*DEC) Length(10) Decimals(0)

#starttime := #datetimex.Now
Begin_Loop To(100)
Select Fields(*ALL) From_File(pslmst)
Endselect
End_Loop
#endtime := #datetimex.Now
#diff := (#endtime.AsSeconds - #starttime.AsSeconds) * 1000
Post Reply