From f16bec6bc98666accc11422bb4222ab416468aa2 Mon Sep 17 00:00:00 2001
From: Paul Sokolovsky <pfalcon@users.sourceforge.net>
Date: Tue, 10 May 2016 15:34:30 +0300
Subject: [PATCH] esp8266/mpconfigport: Reduce various parser-related
 allocation params.

This gives noticeable result for parsing simple input (modelled on 32-bit
unix port):

Before:
>>> micropython.mem_total()
3360
>>> micropython.mem_total()
4472

After:
>>> micropython.mem_total()
3072
>>> micropython.mem_total()
4052

However, effect on parsing large input is much less conclusive, e.g.:

Before:
>>> micropython.mem_total()
3376
>>> import pystone_lowmem
>>> micropython.mem_total()
33006

delta=29630

After:
>>> micropython.mem_total()
3091
>>> import pystone_lowmem
>>> micropython.mem_total()
32509

delta=29418
---
 esp8266/mpconfigport.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/esp8266/mpconfigport.h b/esp8266/mpconfigport.h
index e2c7f57e2..89f3bb952 100644
--- a/esp8266/mpconfigport.h
+++ b/esp8266/mpconfigport.h
@@ -4,6 +4,11 @@
 
 #define MICROPY_OBJ_REPR            (MICROPY_OBJ_REPR_C)
 #define MICROPY_ALLOC_PATH_MAX      (128)
+#define MICROPY_ALLOC_LEXER_INDENT_INIT (8)
+#define MICROPY_ALLOC_PARSE_RULE_INIT   (48)
+#define MICROPY_ALLOC_PARSE_RULE_INC    (8)
+#define MICROPY_ALLOC_PARSE_RESULT_INC  (8)
+#define MICROPY_ALLOC_PARSE_CHUNK_INIT  (64)
 #define MICROPY_EMIT_X64            (0)
 #define MICROPY_EMIT_THUMB          (0)
 #define MICROPY_EMIT_INLINE_THUMB   (0)
-- 
GitLab