diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-05-17 22:45:45 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-05-17 22:45:45 +0900 |
| commit | d2a2af2481908d208965ecc77a8f11065c50be49 (patch) | |
| tree | bfdcc517d2a7da910fcc4e63f1655ff9754188dd | |
| parent | b7bc03aa18f3cc5eac0bbd6690e24062df9fe837 (diff) | |
| parent | a14ae801022291bfa7ffcc15d1acbc0fea3407a6 (diff) | |
| download | mruby-d2a2af2481908d208965ecc77a8f11065c50be49.tar.gz mruby-d2a2af2481908d208965ecc77a8f11065c50be49.zip | |
Merge pull request #4446 from dearblue/PoC-tuning-profiles
(Proof of Concept) mruby tuning profiles [ci skip]
| -rw-r--r-- | include/mrbconf.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/include/mrbconf.h b/include/mrbconf.h index ee816e322..f5e8858ce 100644 --- a/include/mrbconf.h +++ b/include/mrbconf.h @@ -159,4 +159,70 @@ # define TRUE 1 #endif +/* +** mruby tuning profiles +**/ + +/* A profile for micro controllers */ +#if defined(MRB_CONSTRAINED_BASELINE_PROFILE) +# ifndef KHASH_DEFAULT_SIZE +# define KHASH_DEFAULT_SIZE 16 +# endif + +# ifndef MRB_STR_BUF_MIN_SIZE +# define MRB_STR_BUF_MIN_SIZE 32 +# endif + +# ifndef MRB_HEAP_PAGE_SIZE +# define MRB_HEAP_PAGE_SIZE 256 +# endif + +/* A profile for default mruby */ +#elif defined(MRB_BASELINE_PROFILE) + +/* A profile for desktop computers or workstations; rich memory! */ +#elif defined(MRB_MAIN_PROFILE) +# ifndef MRB_METHOD_CACHE +# define MRB_METHOD_CACHE +# endif + +# ifndef MRB_METHOD_CACHE_SIZE +# define MRB_METHOD_CACHE_SIZE (1<<10) +# endif + +# ifndef MRB_METHOD_TABLE_INLINE +# define MRB_METHOD_TABLE_INLINE +# endif + +# ifndef MRB_IV_SEGMENT_SIZE +# define MRB_IV_SEGMENT_SIZE 32 +# endif + +# ifndef MRB_HEAP_PAGE_SIZE +# define MRB_HEAP_PAGE_SIZE 4096 +# endif + +/* A profile for server; mruby vm is long life */ +#elif defined(MRB_HIGH_PROFILE) +# ifndef MRB_METHOD_CACHE +# define MRB_METHOD_CACHE +# endif + +# ifndef MRB_METHOD_CACHE_SIZE +# define MRB_METHOD_CACHE_SIZE (1<<12) +# endif + +# ifndef MRB_METHOD_TABLE_INLINE +# define MRB_METHOD_TABLE_INLINE +# endif + +# ifndef MRB_IV_SEGMENT_SIZE +# define MRB_IV_SEGMENT_SIZE 64 +# endif + +# ifndef MRB_HEAP_PAGE_SIZE +# define MRB_HEAP_PAGE_SIZE 4096 +# endif +#endif + #endif /* MRUBYCONF_H */ |
