Skip to content

Instrument ram cleanup#1327

Closed
n1LS wants to merge 2 commits intoxiphonics:masterfrom
n1LS:instrument-ram-cleanup
Closed

Instrument ram cleanup#1327
n1LS wants to merge 2 commits intoxiphonics:masterfrom
n1LS:instrument-ram-cleanup

Conversation

@n1LS
Copy link
Copy Markdown
Contributor

@n1LS n1LS commented Mar 5, 2026

  • Optimizes padding in Variable and moves the two string pointers into a union
  • Migrates from etl::list to etl::array for the Instrument's Variables() listing.

Figures below are for the pico-build.


Memory region         Used Size  Region Size  %age Used
           FLASH:      716308 B         2 MB     34.16%
             RAM:      233688 B       256 KB     89.14%

Changed Variable containers from etl::list to etl::array

Memory region         Used Size  Region Size  %age Used
           FLASH:      707224 B         2 MB     33.72%
             RAM:      227028 B       256 KB     86.60%

--> 6.660 Bytes (2.54%)

Changes in Variable (padding, union)

Memory region         Used Size  Region Size  %age Used
           FLASH:      707080 B         2 MB     33.72%
             RAM:      222484 B       256 KB     84.87%

--> 4.544 Bytes (1.73%)

==> 11.204 Bytes (4.27%)

@maks maks added this to the 2.4 milestone Mar 12, 2026
@maks maks requested review from democloid and maks April 7, 2026 08:34
Copy link
Copy Markdown
Collaborator

@democloid democloid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to change vector for array that is probably ok, but I don't see why we would change everything so radically when etl::array still offers insert methods, iterators, etc.

We can probably also also put the variable_ initialization in the constructor initializer list if you'd like

Copy link
Copy Markdown
Collaborator

@maks maks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@n1LS these are 2 completely orthogonal changes here, can you please split them into separate PRs so we can review each on its own merits vs the current all or nothing of this PR.

@n1LS
Copy link
Copy Markdown
Contributor Author

n1LS commented Apr 8, 2026

@n1LS these are 2 completely orthogonal changes here, can you please split them into separate PRs so we can review each on its own merits vs the current all or nothing of this PR.

Sure:
#1401 Variable footprint
#1402 List -> Array

If you want to change vector for array that is probably ok, but I don't see why we would change everything so radically when etl::array still offers insert methods, iterators, etc.

etl::array doesn't have insert/push. Using etl::array_view allows the whole thing to be a bit more concise.

We can probably also also put the variable_ initialization in the constructor initializer list if you'd like

That will actually clean things up a bit, good idea.

Both of those changes are in the separated PRs.

@n1LS n1LS closed this Apr 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants