|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
In my Water-Surface-Simulation WIP I have to make
extensive use of array-look-ups and #if statements,
so I'm trying to use the most efficient way for POV
to parse (even though it might be only like 1 or 2 internal
calculations for POV, this adds up quickly with several
thousands of calculations...).
I've already made use that array-look-up is less efficient
than using a "plain" variable, and I've made use of that
where it would have some significant impact (speak:
whenever I look at the same array-entry for more than
three times).
I'm wondering about the boolean parsing. Is it easier
for POV to do
(A!=1) (is A not equal to 1?) or
(A-1) (is A minus 1 true?).
I'm assuming that (A-1) would be better, but I'm not sure
about that. After all, it just has to subtract 1 and see
if value is still true, whereas with A!=1 it would have to
somehow check if A is 1, and if so, return false.
Anybody have some insight into this?
--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: Tim### [at] gmxde
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On Mon, 31 Mar 2003 14:01:25 +0200, "Tim Nikias v2.0" <tim### [at] gmxde> wrote:
> Anybody have some insight into this?
I have made similiar tests some time ago but for different expressions. Look
into tutorials group.
If parsing is really long than you should consider moving to compiled apps
If possible move conditions outside loops
If possible try predeclared functions for longer expressions
If you want compare two versions of expression then create two scripts with
1.000.000 lines of each expression and measure execution time.
ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Thanks for the quick suggestion. In case of
(A-1) and (A!=1) there seems to be no difference.
Its probably just a too easy check to make much
difference...
--
Tim Nikias v2.0
Homepage: http://www.digitaltwilight.de/no_lights
Email: Tim### [at] gmxde
> > Anybody have some insight into this?
>
> I have made similiar tests some time ago but for different expressions.
Look
> into tutorials group.
>
> If parsing is really long than you should consider moving to compiled apps
>
> If possible move conditions outside loops
>
> If possible try predeclared functions for longer expressions
>
> If you want compare two versions of expression then create two scripts
with
> 1.000.000 lines of each expression and measure execution time.
>
> ABX
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Tim Nikias v2.0 wrote:
>
> Thanks for the quick suggestion. In case of
> (A-1) and (A!=1) there seems to be no difference.
> Its probably just a too easy check to make much
> difference...
Since comparison is done by means of subtraction, the two pieces of
code should execute at similar rates.
I'm updating my Surface Subdivision Suite (sharp edges, quadrilateral
faces, and uv-mapping), and it's Slooooooooooow.
Regards,
John
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |