Home RAP
New Blog Posts: Merging Reports - Part 1 and Part 2

RAP performances

edited March 2010 in RAP
Hello, I'm using D7 with RB 9.03 ent. ed.
I'm working on optimization on RAP customer code: our customers are not
programmers, so often into their customized rtm we find bloat code
written into onprint labels events.

For example, one customer wrote onprint code of a memo that is 1000
rows bigger, with tens repetitions of the same test into nested
if.then.else.

Is there any system variable published in ppreport or pppage that
exposes the time elapsed to build every page?

At the present I profile this with simple time elapsing rap code:
procedure memo2onprint;
var
Tm1,Tm2 : DateTime;
begin
Tm1 := CurrentDateTime;
T1.Caption := FormatDateTime('hh.mm.ss.zzz', Tm1);
{tons of redundancy customer code..}
Tm2 := CurrentDateTime;
T2.Caption := FormatDateTime('hh.mm.ss.zzz', Tm2);
TempoTrascorso.Caption := FormatDateTime('hh.mm.ss.zzz', Tm2 - Tm1);
end

My question is due to my hypothesis that 100 repetitions like this:
if (RequestTests['DEVICECODE']='Elecsys') then ...
are slower than this code:
var TheDevice : string;
TheDevice := RequestTests['DEVICECODE'];
followed by 100 if (TheDevice='Elecsys') then ...


thanks

--
Morde

Comments

  • edited March 2010
    > Is there any system variable published in ppreport or pppage that exposes

    No there is no built-in variable that logs execution time, however it may be
    possible to use the report or device events to time them yourself.

    Report.StartPage, Report.EndPage.

    Device.StartPage, Device.ReceivePage, Device.EndPage.

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.