[fpc-devel] Alternative parsers

Alexander Klenin klenin at gmail.com
Tue Oct 19 17:40:32 CEST 2010


On Wed, Oct 20, 2010 at 01:45, Michael Van Canneyt
<michael at freepascal.org> wrote:
> What can be optimized, must be optimized.
Sorry, but does not this sound slightly exaggerated? :-)

>> 2) I may believe that records are faster then classes,
>> but if they are faster then objects, then this is a compiler problem,
>> since there should be literally no difference except the VMT pointer
>> memory overhead. Actual usage of virtual calls may cause a slowdown,
>> but it also may cause a speedup if it replaces a 'case' statement,
>> which is usually so.
>
> The VMT is not the point.
> Objects are zeroed out.

You are wrong. The code below outputs random garbage, not zeroes.

type T1 = object x, y: Integer; end;
procedure P;
var obj: T1;
begin Writeln(obj.x, obj.y); end;
begin P; end.

> It sounds like you give us little credit.
Sorry for that and thanks you for your work.
But, by the same token, don't you think that you also give a little credit to
Hans' work? Maybe his reasons are also good?

> Most things happen for a reason; You just don't know the reason.
I fully understand that the reason for degrading the code structure
was efficiency.
I just doubt that it was/is a good trade-off.

-- 
Alexander S. Klenin



More information about the fpc-devel mailing list