1. A method for optimizing the performance in processing a sequence of images represented as a directed acyclic graph comprising: receiving a selection of a view node from the nodes of the directed acyclic graph, at which point an output image is to be viewed; evaluating the cost to process each predecessor branch of nodes of a plurality of branches of nodes in the directed acyclic graph; rendering the output image by processing the predecessor branches in order from most costly to least costly.