[fpc-pascal] Efficient String concatenation

John Lee johnelee0 at gmail.com
Tue Oct 29 18:17:54 CET 2013


Did you try any other fpc compiler optimisation settings? No expert, but
looks like it isn't too difficult for compiler to spot this.

What about llvm - (coming soon to fpc apparently) - would that fix it?

John


On 29 October 2013 13:22, Graeme Geldenhuys <graeme at geldenhuys.co.uk> wrote:

>  Hi,
>
> This is a very impressive little blog about efficient string concatenation
> in Delphi. But it also applies to Free Pascal.
>
>
> http://www.delphitools.info/2013/10/28/efficient-string-concatenation-in-delphi/
>
>
> I created two versions of the small test project and compiled it with FPC
> as follows.
>
>   $ fpc -O2 -al stringtest.pas
>   $ fpc -O2 -al stringtest2.pas
>
> Then compared the two *.s assembler files. As the blog mentions, the
> "stupid looking" version generates a heck of a lot less ASM code. Umm. :)
>
> Regards,
>   - Graeme -
>
>
>
>
> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20131029/077cc8ed/attachment.html>


More information about the fpc-pascal mailing list