[fpc-devel] Re: Comparison FPC 2.6.2 - Kylix 3

Marco van de Voort marcov at stack.nl
Mon Mar 4 14:18:09 CET 2013


In our previous episode, Mattias Gaertner said:
> > are 50 units loaded, this means 50 symtable lookups, simply because the 
> > operator might be overloaded.
> 
> Is there no cache?
> Something like: Give me all '+' operator overloads in all used units
> of interface, implementation.

>From what I understand of pascal parsing:

You need the implementation highest in the scope stack. "all" doesn't help,
and they can also be implemented in the unit (or even local?) scope.

One would need to build the cache lazily (on first access in a scope), and
somehow avoid rebuilding too often if the scope changes.

> > The situation with Pascal type conversion has grown increasingly complex 
> > over the years. For example almost any type can be converted into a 
> > variant, and a variant can be converted into almost any type. This 
> > requires all kinds of special handling, not only to do the right thing, 
> > but also not to do ineffcient type conversions.
> 
> Can this be cached?
> Maybe the compiler can reuse some results?

No I think not. The context to be checked is probably too large/complex.
 



More information about the fpc-devel mailing list