next up previous notation contents
Next: 4.5 Optimization: Removing Conditionals Up: 4 Graphs Previous: 4.3.5 Examples of Cutting Heuristics

4.4 Optimization: Caching

 

The specification S can be broken into several pieces, based upon its dependence on x and y:

math28444

For example,

math28448

may be transformed into

math28452

with

math28456

math28460

math28464

This is a natural extension of common sub-expression elimination, present in optimizing compilers [3]. Applying common sub-expression elimination in conjunction with symbolic rewriting, the example is transformed into

math28452

with

math28473

math28477

math28464

Such transformations are useful when evaluating S many times, which occurs during rendering.

Let tex2html_wrap_inline38435 ; after evaluating

math28485

the evaluation of

math28489

is more efficient if

math28493

some sub-expressions need not be re-evaluated.

With aligned cuts, it is likely that

math28498

has sub-expressions that have been evaluated before. For example, with cuts aligned along a tex2html_wrap_inline38455 grid,

math28502

are each computed 32 times, instead of 1024 times, if sub-expressions are cached; these calculations assume that every grid cell contains one pixel cluster. Caching tex2html_wrap_inline38461 takes minimal memory, and aids computation considerably; with our previous example, it would be computed once, instead of 1024 times, if tex2html_wrap_inline38461 is cached.

A better estimate of cache utility may be made by considering the graph being rendered. For tex2html_wrap_inline38465 , consider vertical lines, as shown in the following figure:

figure28507

In the example shown, most lines intersect G twice; it follows that tex2html_wrap_inline38465 is usually computed twice, for each possible value of tex2html_wrap_inline38473 . Interval evaluation may ``smear'' the graph, so that tex2html_wrap_inline38465 may be computed several times for each actual intersection.


next up previous notation contents
Next: 4.5 Optimization: Removing Conditionals Up: 4 Graphs Previous: 4.3.5 Examples of Cutting Heuristics
Jeff TupperMarch 1996