Checking conditions [IF ... THEN ... ELSE] performance
|
09-14-2015, 06:24 PM
(This post was last modified: 09-14-2015 08:17 PM by komame.)
Post: #1
|
|||
|
|||
Checking conditions [IF ... THEN ... ELSE] performance
Hi,
I wonder if the checking conditions in HPPL are working properly. It looks that all of the AND conditions are always executed even if first one returns false. The same problem is for the OR conditions when the the first return true. For example, if the expression is composed of three conditions and each of them is false then there is no need to check each of them. This is how languages C, C#, Java and other works. HPPL seems to check every time all the conditions which may greatly slow down the program execution. I did a little test for three conditions that each of them return false: Example: Code: EXPORT TESTCONDITIONS() When the program finishes there will be two measurements of time. First is about 750 [ms] and the second id 360 [ms]. The first is test of 10000 times of three conditions using AND, the second is the same but use of implantation conditions. In the second case the program ran twice as fast. The conditions can be very complex, eg. a complex function which returns true or false. Then check each of them is a large loss of performance. I think HPPL would work like in other languages which would greatly accelerate programs execution. |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Checking conditions [IF ... THEN ... ELSE] performance - komame - 09-14-2015 06:24 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - Joe Horn - 09-14-2015, 07:21 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - Tim Wessman - 09-14-2015, 07:36 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - komame - 09-14-2015, 09:01 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - primer - 09-14-2015, 09:24 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - Joe Horn - 09-15-2015, 05:04 AM
RE: Checking conditions [IF ... THEN ... ELSE] performance - roadrunner - 09-14-2015, 10:06 PM
RE: Checking conditions [IF ... THEN ... ELSE] performance - cyrille de brébisson - 09-15-2015, 05:25 AM
RE: Checking conditions [IF ... THEN ... ELSE] performance - StephenG1CMZ - 09-15-2015, 09:42 AM
|
User(s) browsing this thread: 1 Guest(s)