-
-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move builtin loading code entirely out of __init__ #879
Conversation
... YAY! This paves the way for further improvements.
mathics/version.py
Outdated
@@ -5,4 +5,4 @@ | |||
# well as importing into Python. That's why there is no | |||
# space around "=" below. | |||
# fmt: off | |||
__version__="6.0.2dev0" # noqa | |||
__version__="6.1.0dev0" # noqa |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably should be 7.0.0. Even before this change there were a number of API breaking changes. You'll see them in the recent Mathics3 Modules (natlang, and graph). And we'll have to change these more for this as well.
mathics/core/load_builtin.py
Outdated
|
||
# List of Mathics3 Builtin modules. | ||
# This is initialized via below import_builtins modules | ||
modules = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"modules" is a too vague a name. Probably mathics3_builtin_modules is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree
from mathics.core.parser import MathicsFileLineFeeder, MathicsLineFeeder | ||
from mathics.core.read import channel_to_stream | ||
from mathics.core.rules import BuiltinRule | ||
from mathics.core.streams import stream_manager | ||
from mathics.core.symbols import SymbolNull, strip_context | ||
from mathics.timing import show_lru_cache_statistics | ||
|
||
import_and_load_builtins() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that this section is isolated we could and should be able to time how long running this subroutine takes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the changes look good. Merge this when you feel it is ready.
* module -> mathics3_builtins_modules * Bump version to 7.0.0dev0 * More type annotations * Add in comments debug code to time loading builtin functions I see 2.2secs out of 7 secs to run: mathics -e "1+1"
running Next changes will be to be able to load builtin modules one at a time rather than as a set of sequential loops which do phases of module loading. |
... YAY!
This paves the way for further improvements.