EmbAJAX icon indicating copy to clipboard operation
EmbAJAX copied to clipboard

Work/non template container

Open tfry-git opened this issue 2 years ago • 2 comments
trafficstars

Create container classes that do not depend on templates.

Notes: This also opens the possibility to have elements that can be created, and deleted, dynamically. However, we do not have a real strategy for the latter so far. Introducing regular d'tors would cause the compiler to add a lot of tear-down code even in "static" sketches, for no good reason. Adding a virtual "destroy()" function, instead, does not seem to solve the problem (compiler does not appear to be able to figure out, when this code is unused).

An additional problem is that ownership of resources (e.g. array of child elements, but also string constants) is not clearly defined. Some of that work will definitely have to be delegated to the user.

One "relief", however, is that EmbAJAX objects really never make sense in a local scope. They'll either live on the global scope, or on the heap, never on the stack. Thus, implict d'tor calls are not really needed at all.

tfry-git avatar Apr 29 '23 13:04 tfry-git

Memory usage change @ a701a3ff4eb074cb1e40070e3d14b9b98c7959bf

Board flash % RAM for global variables %
arduino:avr:mega:cpu=atmega2560 :green_heart: -210 - -210 -0.08 - -0.08 :green_heart: -8 - -8 -0.1 - -0.1
esp32:esp32:d32 :green_heart: -664 - -344 -0.05 - -0.03 :grey_question: -48 - +16 -0.01 - 0.0
esp8266:esp8266:huzzah N/A N/A N/A N/A
rp2040:rp2040:rpipicow :green_heart: -432 - -328 -0.02 - -0.02 :grey_question: -52 - +12 -0.02 - 0.0
Click for full report table
Board examples/Blink_Ethernet
flash
% examples/Blink_Ethernet
RAM for global variables
% examples/Blink
flash
% examples/Blink
RAM for global variables
% examples/ConnectionStatus
flash
% examples/ConnectionStatus
RAM for global variables
% examples/Inputs
flash
% examples/Inputs
RAM for global variables
% examples/Joystick
flash
% examples/Joystick
RAM for global variables
% examples/Styling
flash
% examples/Styling
RAM for global variables
% examples/TwoPages
flash
% examples/TwoPages
RAM for global variables
% examples/Visibility
flash
% examples/Visibility
RAM for global variables
%
arduino:avr:mega:cpu=atmega2560 -210 -0.08 -8 -0.1
esp32:esp32:d32 -460 -0.04 8 0.0 -476 -0.04 0 0.0 -444 -0.03 -48 -0.01 -456 -0.03 0 0.0 -664 -0.05 8 0.0 -344 -0.03 0 0.0 -640 -0.05 16 0.0
esp8266:esp8266:huzzah N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
rp2040:rp2040:rpipicow -352 -0.02 4 0.0 -352 -0.02 4 0.0 -368 -0.02 -4 -0.0 -328 -0.02 -52 -0.02 -360 -0.02 -12 -0.0 -400 -0.02 -4 -0.0 -336 -0.02 4 0.0 -432 -0.02 12 0.0
Click for full report CSV
Board,examples/Blink_Ethernet<br>flash,%,examples/Blink_Ethernet<br>RAM for global variables,%,examples/Blink<br>flash,%,examples/Blink<br>RAM for global variables,%,examples/ConnectionStatus<br>flash,%,examples/ConnectionStatus<br>RAM for global variables,%,examples/Inputs<br>flash,%,examples/Inputs<br>RAM for global variables,%,examples/Joystick<br>flash,%,examples/Joystick<br>RAM for global variables,%,examples/Styling<br>flash,%,examples/Styling<br>RAM for global variables,%,examples/TwoPages<br>flash,%,examples/TwoPages<br>RAM for global variables,%,examples/Visibility<br>flash,%,examples/Visibility<br>RAM for global variables,%
arduino:avr:mega:cpu=atmega2560,-210,-0.08,-8,-0.1
esp32:esp32:d32,,,,,-460,-0.04,8,0.0,-476,-0.04,0,0.0,-444,-0.03,-48,-0.01,-456,-0.03,0,0.0,-664,-0.05,8,0.0,-344,-0.03,0,0.0,-640,-0.05,16,0.0
esp8266:esp8266:huzzah,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A
rp2040:rp2040:rpipicow,-352,-0.02,4,0.0,-352,-0.02,4,0.0,-368,-0.02,-4,-0.0,-328,-0.02,-52,-0.02,-360,-0.02,-12,-0.0,-400,-0.02,-4,-0.0,-336,-0.02,4,0.0,-432,-0.02,12,0.0

github-actions[bot] avatar Apr 30 '23 21:04 github-actions[bot]

Memory usage change @ 592e37648870a4a6aa029e6fc59489be0cc985f1

Board flash % RAM for global variables %
arduino:avr:mega:cpu=atmega2560 :green_heart: -336 - -336 -0.13 - -0.13 :green_heart: -108 - -108 -1.32 - -1.32
esp32:esp32:d32 :green_heart: -784 - -388 -0.06 - -0.03 :grey_question: -512 - +8 -0.16 - 0.0
esp8266:esp8266:huzzah N/A N/A N/A N/A
rp2040:rp2040:rpipicow :green_heart: -624 - -360 -0.03 - -0.02 :grey_question: -516 - +4 -0.2 - 0.0
Click for full report table
Board examples/Blink_Ethernet
flash
% examples/Blink_Ethernet
RAM for global variables
% examples/Blink
flash
% examples/Blink
RAM for global variables
% examples/ConnectionStatus
flash
% examples/ConnectionStatus
RAM for global variables
% examples/Inputs
flash
% examples/Inputs
RAM for global variables
% examples/Joystick
flash
% examples/Joystick
RAM for global variables
% examples/Styling
flash
% examples/Styling
RAM for global variables
% examples/TwoPages
flash
% examples/TwoPages
RAM for global variables
% examples/Visibility
flash
% examples/Visibility
RAM for global variables
%
arduino:avr:mega:cpu=atmega2560 -336 -0.13 -108 -1.32
esp32:esp32:d32 -560 -0.04 -128 -0.04 -508 -0.04 0 0.0 -600 -0.05 -184 -0.06 -484 -0.04 0 0.0 -728 -0.06 8 0.0 -388 -0.03 0 0.0 -784 -0.06 -512 -0.16
esp8266:esp8266:huzzah N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A N/A
rp2040:rp2040:rpipicow -416 -0.02 -132 -0.05 -424 -0.02 -124 -0.05 -368 -0.02 -4 -0.0 -624 -0.03 -188 -0.07 -360 -0.02 -12 -0.0 -472 -0.02 -4 -0.0 -368 -0.02 4 0.0 -568 -0.03 -516 -0.2
Click for full report CSV
Board,examples/Blink_Ethernet<br>flash,%,examples/Blink_Ethernet<br>RAM for global variables,%,examples/Blink<br>flash,%,examples/Blink<br>RAM for global variables,%,examples/ConnectionStatus<br>flash,%,examples/ConnectionStatus<br>RAM for global variables,%,examples/Inputs<br>flash,%,examples/Inputs<br>RAM for global variables,%,examples/Joystick<br>flash,%,examples/Joystick<br>RAM for global variables,%,examples/Styling<br>flash,%,examples/Styling<br>RAM for global variables,%,examples/TwoPages<br>flash,%,examples/TwoPages<br>RAM for global variables,%,examples/Visibility<br>flash,%,examples/Visibility<br>RAM for global variables,%
arduino:avr:mega:cpu=atmega2560,-336,-0.13,-108,-1.32
esp32:esp32:d32,,,,,-560,-0.04,-128,-0.04,-508,-0.04,0,0.0,-600,-0.05,-184,-0.06,-484,-0.04,0,0.0,-728,-0.06,8,0.0,-388,-0.03,0,0.0,-784,-0.06,-512,-0.16
esp8266:esp8266:huzzah,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A
rp2040:rp2040:rpipicow,-416,-0.02,-132,-0.05,-424,-0.02,-124,-0.05,-368,-0.02,-4,-0.0,-624,-0.03,-188,-0.07,-360,-0.02,-12,-0.0,-472,-0.02,-4,-0.0,-368,-0.02,4,0.0,-568,-0.03,-516,-0.2

github-actions[bot] avatar May 04 '23 07:05 github-actions[bot]