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

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Mar 4 14:12:23 CET 2013


On Mon, 4 Mar 2013 13:38:50 +0100 (CET)
Daniƫl Mantione <daniel.mantione at freepascal.org> wrote:

>[...]
> Some features only request procesing power if you use them. However, 
> the features in Florian's list require continuous processing power. Two 
> examples how features can impact overall speed:
> 
> 1. Operator overloading
> 
> Operators are some of the most common tokens in source code. Without 
> operator overloading, if you parse an operator, you simply generate a tree 
> node.
> 
> With operator overloading, for each operator that you parse, you have to 
> traverse all loaded units to check if the operator is overloaded. If there 
> 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.

 
> For each operator overload candidate that is found, the compiler has
> need to check for many possible type conversions to see if the candidate 
> can actually be used.
> 
> 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?

 
> So even if you don't use operator overloading or variants at all, they do 
> affect the compiler speed.

Mattias



More information about the fpc-devel mailing list