-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ui: dvc startup became slow #2445
Comments
Might be imports again. Need to check cprofile report, it will make it clear. |
So it's imports:
|
Need to research which modules are causing us the most delay (e.g. boto, paramiko and other remote libs or something else?). And how to solve it? (e.g. simple dynamic imports or writing our own lazy_import implementation or what else?) |
Timed imports:
|
@Suor , how did you timed the imports? |
This should help with iterative#2445
$ PYTHONPROFILEIMPORTTIME=1 dvc --version 2> imports.txt From what I can see
Another things, which can be delayed:
Loading |
Decreases `time dvc --version` from ~1.4 sec to ~0.3 sec. Related iterative#2495 Related iterative#2445 Signed-off-by: Ruslan Kuprieiev <[email protected]>
It's about 200 ms for Here are latest imports profiling: imports.txt So that leaves us:
Our things:
Some of this things intersect so numbers can't be summed up. It feels like to reach under 100 ms for simpler commands we will need more than just making more imports dynamic, some code restructuring might be needed. E.g.:
There are also some extreme approaches like short-circuiting particular commands, like those version and help ones. Ideally nothing should be loaded until cmdline args are parsed and passed. |
So we need to decide how deep we need to go into this hole. If we decide to follow the rabbit then I suggest starting from |
@Suor Thank you for the investigation! 200 ms is pretty good for now, we can leave the rest for the next iteration in the following sprints. |
Closing this for now |
$ time dvc --version 0.57.0+e3f6c7 real 0m2.186s user 0m1.834s sys 0m0.288s
The text was updated successfully, but these errors were encountered: