Re: [fpc-pascal] for loops performance problems?

2017-07-05 Thread fredvs
Hello.

Please take a look at this:

https://www.mail-archive.com/fpc-pascal%40lists.freepascal.org/msg46162.html

and this:

http://www.mail-archive.com/mseide-msegui-talk@lists.sourceforge.net/msg11078.html

fpc has a huge problem for float calculation.

It makes fpc not competitive for audio libraries/programs that use DSP.
Decent today's audio stuffs do use float 32 résolution for samples.

Fre;D



-
Many thanks ;-)
--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/for-loops-performance-problems-tp5729198p5729203.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] for loops performance problems?

2017-07-05 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Wed, 5 Jul 2017, fredvs wrote:

> Please take a look at this:
>
> https://www.mail-archive.com/fpc-pascal%40lists.freepascal.org/msg46162.html
>
> and this:
>
> http://www.mail-archive.com/mseide-msegui-talk@lists.sourceforge.net/msg11078.html
>
> fpc has a huge problem for float calculation.
>
> It makes fpc not competitive for audio libraries/programs that use DSP.
> Decent today's audio stuffs do use float 32 résolution for samples.

This problem has nothing to do with the topic. No, the asker's posted code
is not slow because of this or similar problem, but because it does 10+
function calls inside a tightloop.

Charlie___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] for loops performance problems?

2017-07-05 Thread Anthony Walter
Karloy,

I replaced the calls to World.Vertex/.TexCoord/.Color with a local vertex
buffer (an array of TColorTexVertex) eliminating the function calls you
mentioned. The frames per seconds with vsync off is identical, so I'm
pretty sure that's not causing the slow down. It's either that the
addition/multiplication of floats given the font map (heights/widths stored
in an array) is inefficient or that there is something about the nature of
a for..loop that is causing it to be slow.

I will investigate further.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] for loops performance problems?

2017-07-05 Thread Karoly Balogh (Charlie/SGR)
Hi,

On Wed, 5 Jul 2017, Anthony Walter wrote:

> I replaced the calls to World.Vertex/.TexCoord/.Color with a local
> vertex buffer (an array of TColorTexVertex) eliminating the function
> calls you mentioned. The frames per seconds with vsync off is identical,
> so I'm pretty sure that's not causing the slow down. It's either that
> the addition/multiplication of floats given the font map (heights/widths
> stored in an array) is inefficient or that there is something about the
> nature of a for..loop that is causing it to be slow.

If you still think that loop causes the slowdown, can you post the
generated assembly of it with -al? Otherwise it's really just guesswork.

Also, since you're compiling for ARM if I'm correct, make sure that you

A., using the hardfloat target, and not actually using the softfpu...

B., your data strutures are properly aligned, and any underlying records
are *NOT* declared as packed.

C., you're actually doing aligned accesses indeed, so there are no hidden
exceptions involved from the kernel side, handling the load/store of your
values.

The other example which bubles up again and again, is down to the fact,
that FPC doesn't do autovectorization of that example, while other
compilers, mainly LLVM does. With scalar code, FPC is not that far behind,
if at all.

Charlie
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal