Paulo Gaspar wrote:
> > > Now you cache what Iterator you got per Iterator object but it would be
> > > more efficient to cache it per listObject's class (listObject being the
> > > object to iterate trough in the #foreach).
> >
> > Nooo.... I don't think so. I think I cache the class and type.
> >
> > /*
> > * if we did figure it out, cache it
> > */
> >
> > if ( type != UNKNOWN )
> > {
> > icd = new IntrospectionCacheData();
> > icd.thingy = new Integer( type );
> > icd.contextData = c;
> > context.icachePut( this, icd );
> > }
>
> Yes but "this", the Foreach object, is the key. It would be more efficient
> to have the iterated object's class being the key. You always get the same
> iterator a given iterated object class.
The Foreach object is the key - because we want to lookup by AST node -
that's the semantics of the node caching : for this node in the tree, we
store whatever is relevant. (What we store is different for each
node...) The tree is immutable once it is parsed.
This icache stuff isn't global. You understand that, right?
geir
--
Geir Magnusson Jr. [EMAIL PROTECTED]
Velocity : it's not just a good idea. It should be the law.
http://jakarta.apache.org/velocity
- Iterator introspection nonsense? Paulo Gaspar
- Re: Iterator introspection nonsense? Geir Magnusson Jr.
- RE: Iterator introspection nonsense? Paulo Gaspar
- Re: Iterator introspection nonsense? Geir Magnusson Jr.
- RE: Iterator introspection nonsense? Paulo Gaspar
- Re: Iterator introspection nonsense? Geir Magnusson Jr.
- Re: Iterator introspection nonsense? Geir Magnusson Jr.
- RE: Iterator introspection nonsense? Paulo Gaspar
- RE: Iterator introspection nonsense? Paulo Gaspar
- Re: Iterator introspection nonsense? Geir Magnusson Jr.
- Re: Iterator introspection nonsense? Geir Magnusson Jr.
- RE: Iterator introspection nonsense? Paulo Gaspar
- Re: Iterator introspection nonsense? Geir Magnusson Jr.
- RE: Iterator introspection nonsense? Paulo Gaspar
- Re: Iterator introspection nonsense? Geir Magnusson Jr.
- RE: Iterator introspection nonsense? Paulo Gaspar
- Re: Iterator introspection nonsense? Geir Magnusson Jr.
- Re: Iterator introspection nonsense? jeff
- Re: Iterator introspection nonsense? Geir Magnusson Jr.
- RE: Iterator introspection nonsense? jeff
