Open NitrofMtl opened 2 years ago
Memory usage change @ b05c69cc8882e815e6a5cc01dc148f2b9cf5e3a5
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:avr:LilyPadUSB | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:atmegang:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:atmegang:cpu=atmega8 | :small_red_triangle: 0 - +380 | 0.0 - +5.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:bt:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:bt:cpu=atmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:chiwawa | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:circuitplay32u4cat | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | N/A |
arduino:avr:diecimila:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:diecimila:cpu=atmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:esplora | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:ethernet | :small_red_triangle: 0 - +400 | 0.0 - +1.24 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:fio | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:gemma | 0 - 0 | 0.0 - 0.0 | 0 - 0 | N/A |
arduino:avr:leonardo | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:leonardoeth | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:lilypad:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:lilypad:cpu=atmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:mega:cpu=atmega1280 | :small_red_triangle: 0 - +400 | 0.0 - +0.32 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:mega:cpu=atmega2560 | :small_red_triangle: 0 - +400 | 0.0 - +0.16 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:megaADK | :small_red_triangle: 0 - +400 | 0.0 - +0.16 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:micro | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:mini:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:mini:cpu=atmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:nano:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:nano:cpu=atmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:nano:cpu=atmega328old | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:one | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:pro:cpu=16MHzatmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:pro:cpu=16MHzatmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:pro:cpu=8MHzatmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:pro:cpu=8MHzatmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:robotControl | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:robotMotor | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:uno | :small_red_triangle: 0 - +400 | 0.0 - +1.24 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:unowifi | :small_red_triangle: 0 - +400 | 0.0 - +1.24 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:yun | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:yunmini | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
Memory usage change @ e55d1612e2cc924c66188c7a7ca0afa56ddd5594
Board | flash | % | RAM for global variables | % |
---|---|---|---|---|
arduino:avr:LilyPadUSB | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:atmegang:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:atmegang:cpu=atmega8 | :small_red_triangle: 0 - +380 | 0.0 - +5.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:bt:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:bt:cpu=atmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:chiwawa | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:circuitplay32u4cat | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | N/A |
arduino:avr:diecimila:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:diecimila:cpu=atmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:esplora | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:ethernet | :small_red_triangle: 0 - +400 | 0.0 - +1.24 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:fio | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:gemma | 0 - 0 | 0.0 - 0.0 | 0 - 0 | N/A |
arduino:avr:leonardo | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:leonardoeth | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:lilypad:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:lilypad:cpu=atmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:mega:cpu=atmega1280 | :small_red_triangle: 0 - +400 | 0.0 - +0.32 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:mega:cpu=atmega2560 | :small_red_triangle: 0 - +400 | 0.0 - +0.16 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:megaADK | :small_red_triangle: 0 - +400 | 0.0 - +0.16 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:micro | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:mini:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:mini:cpu=atmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:nano:cpu=atmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:nano:cpu=atmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:nano:cpu=atmega328old | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:one | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:pro:cpu=16MHzatmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:pro:cpu=16MHzatmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:pro:cpu=8MHzatmega168 | :small_red_triangle: 0 - +400 | 0.0 - +2.79 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:pro:cpu=8MHzatmega328 | :small_red_triangle: 0 - +400 | 0.0 - +1.3 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:robotControl | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:robotMotor | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:uno | :small_red_triangle: 0 - +400 | 0.0 - +1.24 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:unowifi | :small_red_triangle: 0 - +400 | 0.0 - +1.24 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:yun | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
arduino:avr:yunmini | :small_red_triangle: 0 - +400 | 0.0 - +1.4 | 0 - 0 | 0.0 - 0.0 |
Hi.
I modified the WString library to add Short String Optimization.
If string is 11 char or less, it is store into the stack, bigger, on the heap.
String object is 1 byte bigger to hold the sate short/long Library is around 200 byte bigger. Short string are about 2 time more fast, long string are lightly slower. But a second look can surly find more code optimization.
I kept the old version code into ifdef macro to compare the two easily.
Here a basic example to demonstrate the performance, and some stats obtain with it:
Others design notes:
buffer()
do not work well, should be debug to stop usingoperator()()
, for clarity, also to avoid to always useconst_cast