Data Compaction - Compression without Decompression
came across article how use overlapping parts of arrays minimize memory footprint.
the technique useful non changing arrays e.g. lookup tables (progmem) when run out of memory.
(yes uses pointers)
the technique boils down . e.g. have 2 array's
a[] = { 1,2 3,4,5,6,7 8, 9, 10} // 10 bytes
b[] = { 7, 8, 9, 10, 11,12, 13} // 7 bytes
you can replace
x[]= { 1,2 3,4,5,6,7 8, 9, 10, 11,12, 13} // 12 bytes
*a = &x[0]; // 2 bytes
*b = &x[6]; //2 bytes
the 2nd storage structure gains 1 byte (just example)
conclusion
- break if overlap == pointersize
- gain if overlap > pointersize
still interesting technique approaching 32k limit of uno
the article - http://arxiv.org/abs/1402.2508v1 -
Arduino Forum > General Category > General Discussion (Moderators: mbanzi, DojoDave, mellis) > Data Compaction - Compression without Decompression
arduino
Comments
Post a Comment