Optimizations
The compiler performs optimizations to make sure that all formulas run as fast as possible. It is
helpful to know something about these optimizations when writing formulas.
The optimizations can be divided into two categories:
G
Evaluation of constant expressions. Constant expressions are expressions whose value can
be evaluated by the compiler. Constant expressions can contain operators, functions,
constants and parameters. This is possible because the formula is re compiled each time a
parameter changes, so parameters can be treated as constants by the compiler.
G
Replacement of slow operations by faster ones, such as replacing 2*x by x+x (adding is
faster than multiplying).
When writing formulas, this has the following consequences:
G
Writing to parameters is not recommended. This can make the formula run slower, because
parameters cannot be treated as constants anymore.
G
You can write constant expressions wherever you want. You do not have to precalculate
them, because the compiler can do that for you. So, using 2 + 1/3 is just as fast as using
2.3333. Just use whatever you find most convenient.
G
If statements with constant expressions (like if 3 < 2) are completely eliminated by the
compiler. This is very helpful when you use lots of if statements depending on the values of
enumerated parameters
. Therefore making your formula versatile by providing many options
does not cause it to run slower.
G
You can use descriptive operators like z^4 instead of z*z*z*z or sqr(sqr(z)), since Ultra
Fractal automatically chooses the most efficient operation independent of the operators or
functions used.
Next:
Compatibility
See Also
Conditionals
297
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved