OPT0001: String comparison with empty string is optimized tos.len == 0OPT0002: Several string concatenations are optimized to a single oneOPT0003: Match over constant strings is optimized to int comparisonsOPT0004: Removal of unnecessarymem.to_heapcallsOPT0005: Layout optimization for Option-like unionsOPT0006: Constant folding for stringsOPT0007: Inlining of small functions
- In string interpolation with integers don't clone string for integer
(in
int_to_str), pass string with stack-data tostr_intrp. Thanks to this we can avoid extra allocation for each integer in string interpolation. - Optimize
ifexpressions toif-else-ifif possible, this way we can help to C compiler use jump table optimization. - allocate constants with an array in static memory