-
Notifications
You must be signed in to change notification settings - Fork 326
Optimize import speed for Mars package #3022
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
Conversation
e95e065 to
c2907d6
Compare
|
Great work, with this optimization, the import time has reduced from 5s to 2s. |
For this result, seems that vineyard is importing kubernetes and pkg_resources, contributing to a long load time. Will fix right now. |
sighingnow
left a comment
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.
LGTM.
It's ok to import vineyard lazily, thanks for addressing that.
|
Any further optimization? @chaokunyang @wjsi |
|
Tooks 1.6s now, any chance that to limit it to 1 second? |
Seems vineyard is still importing via Given my tests, after vineyard is installed, it is not imported now. As the majority of time cost is brought by |
| input_keys: List[str], | ||
| *inputs, | ||
| ): | ||
| from .....optimization.physical import optimize |
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.
Import inside the function makes it runs slow. Also it's better to import at top of the file: https://peps.python.org/pep-0008/#imports
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.
When sticking to fast import we have no choices but make compromises. @chaokunyang any ideas?
chaokunyang
left a comment
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.
Seems there are still improvement space for mars init, but I think we can merge this first, and leave further optimization in laster pr
qinxuye
left a comment
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.
LGTM
qinxuye
left a comment
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.
LGTM



What do these changes do?
Related issue number
Fixes #3020
Check code requirements