Thanks. Yeah, serializer does work with USE_CACHE but then you've got
problems with BitmapDatas. This isn't probably very good for my use
anyway as I'm trying to build Collada Scenes out of multiple different
parts so the internal linking would be all over the place between
different objects in the serialized scene. Currently the Hash /
Dictionary fix makes things fast enough for most uses.

Thanks again.

On Jul 6, 3:44 am, Cauê Waneck <[email protected]> wrote:
> about the Serializer, I think it suffers from the same problem as this code.
> The Collada has some circular references, but if you set the USE_CACHE
> option to true, it will take quadratic time to serialize each object. The
> solution would be simple, that is to add a TypedDictionary to it for the
> cache, instead of the array it uses currently. If you want to try it out, it
> should be simple to change. And should have an even superior performance,
> (hopefully)!
>
> 2010/7/5 Cauê Waneck <[email protected]>
>
>
>
>
>
> > 2010/7/5 tarwin <[email protected]>
>
> > Seems I ain't so stupid after all ... I just updated the function and
> >> got from 1.65 seconds to 0.29 seconds!!! Yay for super big differences
> >> in speed. Here's the updated code for the haXe version - should be
> >> fine in the Flash version too.
>
> > Hey! Pretty cool!!! : )
> > I'll try to integrate it into the svn. : )
>
> >> The only problem is that it seems to speed things up for parsing, but
> >> makes displaying 6 times slower when playing your animation (or
> >> something like that?!) Can anyone explain it?
>
> > Shouldn't the TypedDictionary be declared as a class member? I think it
> > should work like this:
>
> >     private var _skinVerticesHash:flash.utils.TypedDictionary<SkinVertex,
> > Bool>; //don't forget to create a new instance in the constructor!
>
> >     /**
> >      * Adds a <code>SkinController</code> and all associated
> > <code>SkinVertex</code> objects to the animation.
> >      */
>
> >     public function addSkinController(skinController:SkinController):Void
> >     {
> >         if (_skinControllers.indexOf(skinController) != -1)
> >             return;
>
> >         _skinControllers.push(skinController);
>
> >         for (_skinVertex in skinController.skinVertices)
> >         {
> >             if (!_skinVerticesHash.exists(_skinVertex))
> >             {
> >                 _skinVertices.push(_skinVertex);
> >                 _skinVerticesHash.set(_skinVertex, true);
> >             }
> >         }
> >     }
>
> >> ----------------------------------------------------------
>
> >>        public function
> >> addSkinController(skinController:SkinController):Void
> >>        {
> >>                if (_skinControllers.indexOf(skinController) != -1)
> >>                        return;
>
> >>                _skinControllers.push(skinController);
>
> >>                 var d:flash.utils.TypedDictionary<SkinVertex, Bool> = new
> >> flash.utils.TypedDictionary(true);
>
> >>                for (_skinVertex in skinController.skinVertices) {
> >>                         if (!d.exists(_skinVertex)){
> >>                                _skinVertices.push(_skinVertex);
> >>                                d.set(_skinVertex, true);
> >>                        }
> >>                }
> >>        }
>
> >> ----------------------------------------------------------

Reply via email to