-
Notifications
You must be signed in to change notification settings - Fork 537
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
[UX] minor optimizations for launch and introduce py-spy #4495
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Aylei <[email protected]>
Signed-off-by: Aylei <[email protected]>
@Michaelvll please kindly review this PR |
ace3325
to
be60a18
Compare
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.
Thanks @aylei! It looks mostly good to me.
# slow due to https://github.com/python-pendulum/pendulum/issues/808 | ||
# FIXME(aylei): bump pendulum if it get fixed | ||
import pendulum |
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.
We can even get rid of this package, as we have also been observing inaccurate translation of the timestamp to readable time.
# requests and inspect cost ~100ms to load, which can be postponed to | ||
# collection phase or skipped if user specifies no collection | ||
requests = adaptors_common.LazyImport('requests') | ||
inspect = adaptors_common.LazyImport('inspect') |
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.
In the future, it might be good to have the usage being called asynchronously.
I've investigated python profiling tools when developing #3159 since
python -m cProfile
only sees profile on main thread and profiling multi-thread applications using cProfile is tedious. I evaluated yappi and py-spy, it turns out the latter one has better UX and broader adoption. Therefore, I propose changing the profiling approach in dev guide to py-spy.Also, I found some minor optimization chances and made some quicks in this PR.
sky launch
speed up 100ms in average:Tested (run the relevant ones):
bash format.sh
pytest tests/test_smoke.py
pytest tests/test_smoke.py::test_fill_in_the_name
conda deactivate; bash -i tests/backward_compatibility_tests.sh
appendix: