[fpc-devel] Patch to speed up Uppercase/Lowercase functions

Daniël Mantione daniel at deadlock.et.tudelft.nl
Sun Jun 12 13:20:43 CEST 2005



Op Sun, 12 Jun 2005, schreef Uberto Barbini:

> > > If I understood well, with modern processor an unpredicatable branch
> > > (i.e. one with similar probability) is much more time-consuming that an
> > > unnecessary function call.
> >
> > Yes, but the call needs to do memory allocation and a string copy, so it
> > is not just the call.
>
> I thought that UniqueString() goal was exactly to avoid the string copy...
>
> > > ps. is there a way to see the assembly producted by a FPC function?
> >
> > Sure. Depending on your prefered asm style:
> >
> > fpc -Anasmelf -a -s filename.pas
> > fpc -Agas -a -s filename.pas
>
> Thanks!
> I wonder if anyone has checked why Kylix version is faster comparing the
> assembler code.
>
> I read the thread but I haven't studied well! ;)

Of course, we know our strong and weak points very well.

Borland's compiler does register variables better than FPC and can do
induction variables. This has a large impact on the code generation in
general. FPC beats Delphi when you start to use int64 or the heap
(like object oriented programming). It can also provide some kick ass FPU
performance when using SSE2.

Daniël





More information about the fpc-devel mailing list