Re: [Emc-developers] Link-time optimization in realtime objects

2019-08-16 Thread Nicklas Karlsson
> ...
> I think the only way to find out is to test it.
> On the face of it, short functions, repeatedly used, should benefit from it.

Then programming for Micro controller I quite often then there is no or little 
difference between different methods for other reasons check size of compiled 
code constructions to learn which one produce the smallest code. I would not be 
suprised if smaller code with fewer instructions also execute faster. Most of 
time difference in execution time and size is small and not very imortant 
though I still consider it good to learn otherwise optimizations might go the 
wrong way or constructions consuming quite large resources may be used without 
a good reason.

What is missing is a tool to calculate worst case execution time.


Nicklas Karlsson


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Link-time optimization in realtime objects

2019-08-16 Thread mydani
Hi all,

the link-time optimization as such is highly dependant on the target
architecture (as well as the compiler/linker suite of course).

While on smaller, more simple core architectures, e.g. small µCs, the
effect can be quite large, on µP architectures with complex multi level
caches, intelligent prefetch whatsoever, it's most of the times a matter of
try and error whether the optimization is really helpful.
If you now consider the code might be run on different processors, it
renders the effort more on the waste than helpful side.

But try it anyways and let us know what you think!

Regards,
Daniel



Am Fr., 16. Aug. 2019 um 15:34 Uhr schrieb schoone...@gmail.com <
schoone...@gmail.com>:

>
> On 16/08/19 13:04, Robert Ellenberg wrote:
> > Hi All,
> >
> > Has anyone tried to use link-time optimization in the realtime object
> > builds? I think the motion / TP build would be a good candidate for it,
> so
> > we could improve inlining of things like posemath.
> >
> > Best,
> > Rob
> >
> >
> Hi Rob,
>
> In an ideal world, the inline code in question should be inserted by the
> compiler,
> removing the call and stack shuffling thus producing a faster binary.
> What the compiler actually does sometimes differs.;-)
>
> If the code is long, a couple of push/pops from the stack if negligible,
> compared to the amount of binary code bloat you can get, sometimes at
> the expense
> of code sitting nicely in processor cache ready to be instantly called
> again.
>
> I think the only way to find out is to test it.
> On the face of it, short functions, repeatedly used, should benefit from
> it.
>
> Nothing in defining inlines should affect rt operation AFAIK,
> we have shed loads of inlines and defined functions in the revised rtai
> / hal code in Machinekit.
> (mostly wrapper functions and accessors etc. to cater for both legacy
> code and the newer code)
>
> cheers
>
>
> ___
> Emc-developers mailing list
> Emc-developers@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-developers
>

___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers


Re: [Emc-developers] Link-time optimization in realtime objects

2019-08-16 Thread schoone...@gmail.com



On 16/08/19 13:04, Robert Ellenberg wrote:

Hi All,

Has anyone tried to use link-time optimization in the realtime object
builds? I think the motion / TP build would be a good candidate for it, so
we could improve inlining of things like posemath.

Best,
Rob



Hi Rob,

In an ideal world, the inline code in question should be inserted by the 
compiler,

removing the call and stack shuffling thus producing a faster binary.
What the compiler actually does sometimes differs.;-)

If the code is long, a couple of push/pops from the stack if negligible,
compared to the amount of binary code bloat you can get, sometimes at 
the expense
of code sitting nicely in processor cache ready to be instantly called 
again.


I think the only way to find out is to test it.
On the face of it, short functions, repeatedly used, should benefit from it.

Nothing in defining inlines should affect rt operation AFAIK,
we have shed loads of inlines and defined functions in the revised rtai 
/ hal code in Machinekit.
(mostly wrapper functions and accessors etc. to cater for both legacy 
code and the newer code)


cheers


___
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers