Hello Kiste,
Thank you for your input.
Cheers,
FS
On Sunday, August 21, 2022 at 12:03:37 PM UTC+1 Kiste wrote:
> Hi Filipe,
>
> I can tell you für 2): No. At compile time, the variable name is replaced
> by a fixed memory address. There's no difference if the name is declared
> inside a procedure/function or in the main program. There is, however, a
> little space ("access RAM") which contains a bit "faster" variables. So, it
> can make a little difference if a variable is declared earlier or later in
> a program.
>
> 8-bit PIC controllers are a bit special, as in a sense they don't have RAM
> at all, they merely have up to several thousand processor registers.
> Accessing (simple, not array) variables is therefore very fast compared to
> other processor architectures.
>
> Greets,
> Kiste
>
> Am Sonntag, 21. August 2022, 12:49:39 MESZ hat flyway38 <[email protected]>
> Folgendes geschrieben:
>
>
> Hi all,
>
> Always had this doubt about efficiency in choosing Procedure or Function
> for structuring my code. I know how to use them by experience in coding JAL
> for many years.
> Another doubt is declaring VARs inside Procedures or Functions will make
> them slower or not..., so here goes the questions;
>
> 1) - Which is the fastest/ efficient at runtime (Procedure or Function) ?
> 2) - Declaring VARs inside Procs/Funcs will make them slower ?
>
> Thank you very much
>
> Kind regards,
> Filipe Santos
>
> --
> You received this message because you are subscribed to the Google Groups
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jallib/049c5097-750d-4cf7-845a-a89720963961n%40googlegroups.com
>
> <https://groups.google.com/d/msgid/jallib/049c5097-750d-4cf7-845a-a89720963961n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jallib/365d7bab-9091-4ac5-b55f-265f5cd23104n%40googlegroups.com.