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.
Affect of non-live code on performance
- Electroguard
- Posts: 852
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 273 times
- Been thanked: 321 times
- cicciocb
- Site Admin
- Posts: 1979
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 425 times
- Been thanked: 1320 times
- Contact:
Re: Affect of non-live code on performance
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.
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.
- Electroguard
- Posts: 852
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 273 times
- Been thanked: 321 times
Re: Affect of non-live code on performance
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.
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: 1979
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 425 times
- Been thanked: 1320 times
- Contact:
Re: Affect of non-live code on performance
This could be true for the ESP32 because the code is copied in the RAM but for not for the ESP8266.[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.
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)