[DUG] Curious re efficiency of using in [set of integer]
Ross Levis
ross at stationplaylist.com
Mon Aug 15 22:55:48 NZST 2022
I did have to do some assignments to a variable and do a test on it to stop optimization.
From: delphi-bounces at listserver.123.net.nz [mailto:delphi-bounces at listserver.123.net.nz] On Behalf Of Tech Benner
Sent: Monday, 15 August 2022 9:09 pm
To: delphi at listserver.123.net.nz
Subject: Re: [DUG] Curious re efficiency of using in [set of integer]
Hi Rohit,
Could that same operation be affected by any optimisation?
Perhaps change the integer for each of the 10,000 ops.
I'm not sure but I've been caught out before with such things.
Cheers
Gary
On 15/08/2022 6:00 pm, Rohit Gupta wrote:
Just put it in a loop of 10k and time it.
But honestly, does it really matter?
Regards
Rohit
15/08/2022 17:34:14 Ross Levis <mailto:ross at stationplaylist.com> <ross at stationplaylist.com>:
Var Total: Integer;
If I want to test 2 or 3 values of an integer, I often use
if Total in [4,6] then ...
But is that more or less efficient for the CPU/ASM coding than
if (Total = 4) or (Total = 6) then ...
I’m not sure how to find out myself.
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi at listserver.123.net.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-request at listserver.123.net.nz with Subject: unsubscribe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20220815/d9c17bbe/attachment.html
More information about the Delphi
mailing list