Hi,
I was wondering if there is any performance impact when using Begin/End. I have 2 different examples and was wondering if they are really only style differences or if there is an underlying performance hit when using Begin/End when it is not really needed.
Example 1:
IF <condition> THEN
<Do Something>;
vs
IF <condition> THEN BEGIN
<Do Something>;
END;
Example 2
IF Record.FINDSET THEN
REPEAT
<Do Something>;
UNTIL Record.NEXT = 0;
vs
IF Record.FINDSET THEN BEGIN
REPEAT
<Do Something>;
UNTIL Record.NEXT = 0;
END;
Thank you in advance.
0
Answers
Can't think of any reason then (lazy) to not use it.
If you do some database access, we are talking about milliseconds.
So 1 millisecond (generally more) for a database access + 10 microseconds (I think I am thinking LARGE!) for the extra processing = 1010 microseconds for everything.
=> I wouldn't care about those 10 microseconds!
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
And as Kriki points out database access is where most of the time is spend which makes it a lot more important to write code that is readable than code which executes a couple of milliseconds faster