         }
         const xflMovie :MovieMold = _lib.getLibrary(name, MovieMold);
         var maxDrawn :int = 0;
+        var calculatedKeyframes :Map = Maps.newMapOf(KeyframeMold);
         for (var ii :int = 0; ii < xflMovie.frames; ii++) {
             var drawn :int = 0;
             for each (var layer :LayerMold in xflMovie.layers) {
                 var kf :KeyframeMold = layer.keyframeForFrame(ii);
-                if (kf.visible) drawn += getMaxDrawn(kf.id);
+                if (kf.visible) {
+                    if (!calculatedKeyframes.containsKey(kf)) {
+                        calculatedKeyframes.put(kf, getMaxDrawn(kf.id));
+                    }
+                    drawn += calculatedKeyframes.get(kf);
+                }
             }
             maxDrawn = Math.max(maxDrawn, drawn);
         }

import starling.display.Image;
import starling.display.Sprite;
import starling.textures.Texture;

public class DisplayCreator
{


package flump.export {

import flash.utils.Dictionary;

import flump.SwfTexture;
