From 693b927687c3ac18726a5eb7b64127fc347a3c41 Mon Sep 17 00:00:00 2001 From: Jim Mussared Date: Mon, 20 Sep 2021 22:43:39 +1000 Subject: [PATCH] rp2: Enable optimisations (comp goto, map cache, fast attr). Computed goto costs 1800 bytes for 5-10% performance. Map caching and attr fast path costs 130 bytes for up to 30%. Net effect of those three optimisations: bm_chaos.py +16.059% (+/-0.09%) bm_fannkuch.py +11.145% (+/-0.01%) bm_fft.py +14.604% (+/-0.01%) bm_float.py +26.849% (+/-0.08%) bm_hexiom.py +34.039% (+/-0.03%) bm_nqueens.py +18.333% (+/-0.06%) bm_pidigits.py +4.472% (+/-0.03%) misc_aes.py +28.765% (+/-0.09%) misc_mandel.py +27.116% (+/-0.05%) misc_pystone.py +40.299% (+/-0.20%) misc_raytrace.py +22.812% (+/-0.07%) Also enable other EXTRA-level optimisations (module const, return_if_expr, triple_tuple_assign, factorial, mpz bitwise). Signed-off-by: Jim Mussared --- ports/rp2/mpconfigport.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/ports/rp2/mpconfigport.h b/ports/rp2/mpconfigport.h index 788aeb1638..2794fda2e1 100644 --- a/ports/rp2/mpconfigport.h +++ b/ports/rp2/mpconfigport.h @@ -55,16 +55,11 @@ #define MICROPY_EMIT_INLINE_THUMB_FLOAT (0) #define MICROPY_EMIT_INLINE_THUMB_ARMV7M (0) +// Optimisations +#define MICROPY_OPT_COMPUTED_GOTO (1) + // Features currently overriden for rp2, planned to be brought in line with // other ports -#define MICROPY_COMP_MODULE_CONST (0) -#define MICROPY_COMP_RETURN_IF_EXPR (0) -#define MICROPY_COMP_TRIPLE_TUPLE_ASSIGN (0) -#define MICROPY_OPT_COMPUTED_GOTO (0) -#define MICROPY_OPT_LOAD_ATTR_FAST_PATH (0) -#define MICROPY_OPT_MAP_LOOKUP_CACHE (0) -#define MICROPY_OPT_MATH_FACTORIAL (0) -#define MICROPY_OPT_MPZ_BITWISE (0) #define MICROPY_PY_BUILTINS_EXECFILE (0) #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) #define MICROPY_REPL_EMACS_KEYS (0)