Affect of non-live code on performance

If doesn't fit into any other category ....
Post Reply
User avatar
Electroguard
Posts: 287
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 57 times
Been thanked: 136 times

Affect of non-live code on performance

Post by Electroguard »

Do unused subroutines affect Annex, CiccioCB ?

Sometimes I 'evolve' eg: a periodic timer 'Ticker' subroutine to keep adding all the required flag-trapping behaviours, until it becomes too much of a tangled mess.
Then I rename it to something like tickerX for safe-keeping and start with a new clean Ticker, just neatly adding back in functionalities from tickerX to Ticker in a more orderly and integrated manner.

I could comment out all the old tickerX, but it would make it much harder to read and understand, especially as it would undoubtedly already contain non-live lines that had been previously commented out (eg: if trying out alternatives I often copy the original line(s) then edit the copies while leaving the originals commented out for quick restore if needed, and the same can apply to complete alternative subroutines).

It's been my understanding that Annex ignores comments and un-referenced subroutines, but I thought I should ask in case it might have an impact on performance.
cicciocb
Site Admin
Posts: 428
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 95 times
Been thanked: 311 times
Contact:

Re: Affect of non-live code on performance

Post by cicciocb »

Hi Robin,
all the comments are stripped out when the code is loaded in the internal memory.
The unused code is still copied in the memory but do not effects the performance.
User avatar
Electroguard
Posts: 287
Joined: Mon Feb 08, 2021 6:22 pm
Has thanked: 57 times
Been thanked: 136 times

Re: Affect of non-live code on performance

Post by Electroguard »

Hmm, so it's possible for unused code to contribute to an 'out of memory' error.
But in event of an 'out of memory' error, any unused code could be converted to comment to ease the situation.
Thank you sir.
cicciocb
Site Admin
Posts: 428
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 95 times
Been thanked: 311 times
Contact:

Re: Affect of non-live code on performance

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue Dec 07, 2021 3:14 pm Hmm, so it's possible for unused code to contribute to an 'out of memory' error.
But in event of an 'out of memory' error, any unused code could be converted to comment to ease the situation.
Thank you sir.
This could be true for the ESP32 because the code is copied in the RAM but for not for the ESP8266.
However, starting from the latest releases, the code is copied in the external PSRAM that is 4MB .... (obviously this is true only for modules equipped)
Post Reply