[fpc-devel] Patch for rtl/inc/rtti.inc

Daniël Mantione daniel.mantione at freepascal.org
Sun Sep 14 16:11:59 CEST 2008



Op Sun, 14 Sep 2008, schreef Jonas Maebe:

>
> On 14 Sep 2008, at 14:49, Markus Beth wrote:
>
>> this patch rewrites code of ArrayRTTI and fpc_Copy to allow the compiler to 
>> generate faster code (at least on i386).
>> The change in ArrayRTTI yields a performance gain of ~4% for our real world 
>> application on a 3 GHz Intel Xeon.
>> The change in fpc_Copy is completely untestet because I don't know when 
>> this compilerproc is called. Maybe someone who knows can hack a quick 
>> benchmark...
>
> I don't think it's a good idea to start manually adding loop induction 
> variables to many routines in the rtl. It makes the code less maintainable, 
> and at one point the compilation process itself will/should do that by 
> itself.

This patch should get applied. It's debatable wether additions are hard to 
maintain than multiplications and it may take years before the compiler 
can do that optimization. That doesn't mean we should optimize anything 
manually, but fpc_copy is definately speed critical code for things like 
widestrings.

Daniël


More information about the fpc-devel mailing list