Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
346aacf2
Commit
346aacf2
authored
Nov 05, 2014
by
Paul Sokolovsky
Browse files
unix: fast: Set initial module dict size big to have high pystone score.
For this, introduce MICROPY_MODULE_DICT_SIZE config setting.
parent
ff8d0e07
Changes
3
Hide whitespace changes
Inline
Side-by-side
py/mpconfig.h
View file @
346aacf2
...
...
@@ -100,6 +100,11 @@
#define MICROPY_ALLOC_PATH_MAX (512)
#endif
// Initial size of module dict
#ifndef MICROPY_MODULE_DICT_SIZE
#define MICROPY_MODULE_DICT_SIZE (1)
#endif
/*****************************************************************************/
/* Micro Python emitters */
...
...
py/objmodule.c
View file @
346aacf2
...
...
@@ -96,7 +96,7 @@ mp_obj_t mp_obj_new_module(qstr module_name) {
mp_obj_module_t
*
o
=
m_new_obj
(
mp_obj_module_t
);
o
->
base
.
type
=
&
mp_type_module
;
o
->
name
=
module_name
;
o
->
globals
=
mp_obj_new_dict
(
1
);
o
->
globals
=
mp_obj_new_dict
(
MICROPY_MODULE_DICT_SIZE
);
// store __name__ entry in the module
mp_obj_dict_store
(
o
->
globals
,
MP_OBJ_NEW_QSTR
(
MP_QSTR___name__
),
MP_OBJ_NEW_QSTR
(
module_name
));
...
...
unix/mpconfigport_fast.h
View file @
346aacf2
...
...
@@ -30,3 +30,6 @@
#include
<mpconfigport.h>
#define MICROPY_PY___FILE__ (0)
// 91 is a magic number proposed by @dpgeorge, which make pystone run ~ at tie
// with CPython 3.4.
#define MICROPY_MODULE_DICT_SIZE (91)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment