mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -10,8 +10,8 @@
|
||||
|
||||
#define fiber_ptr(o) ((struct RFiber*)mrb_ptr(o))
|
||||
|
||||
#define FIBER_STACK_INIT_SIZE 64
|
||||
#define FIBER_CI_INIT_SIZE 8
|
||||
#define FIBER_STACK_INIT_SIZE 16
|
||||
#define FIBER_CI_INIT_SIZE 4
|
||||
/* copied from vm.c */
|
||||
#define CINFO_RESUMED 3
|
||||
|
||||
|
||||
Reference in New Issue
Block a user