mruby-fiber: optimize initial memory allocation sizes

Reduce FIBER_STACK_INIT_SIZE from 64 to 16 and FIBER_CI_INIT_SIZE
from 8 to 4 based on runtime analysis. Data shows typical usage
is 5-8 stack registers and 4 callinfo slots, achieving ~75% memory
reduction per fiber while preserving dynamic growth.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2025-08-12 08:50:16 +09:00
parent 856373df35
commit 3246dd2562
+2 -2
View File
@@ -10,8 +10,8 @@
#define fiber_ptr(o) ((struct RFiber*)mrb_ptr(o)) #define fiber_ptr(o) ((struct RFiber*)mrb_ptr(o))
#define FIBER_STACK_INIT_SIZE 64 #define FIBER_STACK_INIT_SIZE 16
#define FIBER_CI_INIT_SIZE 8 #define FIBER_CI_INIT_SIZE 4
/* copied from vm.c */ /* copied from vm.c */
#define CINFO_RESUMED 3 #define CINFO_RESUMED 3