Commit Graph

8 Commits

Author SHA1 Message Date
Jeff Epler de541cf155
Fix pointer-ness, const-ness of compressed messages
micropython puts the pointer-ness into the typedef; we can put the
const-ness there too.

this reduces the delta to micropython; for instance, emitinlinextensa
and emitinlinethumb now match upstream.
2023-10-25 21:40:11 +02:00
Jeff Epler 55874b6470
Rename compressed_string_t to mp_rom_error_text_t to match upstream 2023-10-25 08:14:13 +02:00
Jeff Epler 4d8b354c13
Use qstrs to improve compression
any qstr of >= 3 chars long is a candidate for use; the input byte value
(1) is used to indicate a fixed-length qstr number follows.

Before accounting for the code size changes, this saves ~100 bytes
on trinket m0, but it may end up being a wash due to added code.

A cutoff of length>2 is slightly better for ja and ru and worse for others.
This has to do with the relative frequency of latin characters vs non-latin
characters, is my guess.

lang    after   before  change (- = more free space)
en_US   3132    2996    -134
fr      2136    2060    -76
ja      1916    1724    -232
ru      2196    2000    -196
2023-08-23 15:16:53 -05:00
Dan Halbert fe0e2f13bc wip; fix qstr processing 2023-08-10 20:06:32 -04:00
Jeff Epler fb66a6bfe5
Don't use "offset" as an identifier 2022-11-30 14:39:54 -06:00
Jeff Epler d16c9515b7
Compact the characters of certain translations, so they fit in uint8_t
This saves a few hundred bytes on the affected translations, such
as `el` which shrunk from 186152 to 185588 bytes (564 bytes saved).
2022-11-30 14:39:53 -06:00
Scott Shawcroft 4d776339ad
Separate translate object control from LTO 2022-05-31 12:42:59 -07:00
Scott Shawcroft 9d10a3da66
Conditionalize LTO 2022-05-27 12:59:54 -07:00