Skip to content
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

Оптимизация импортов #46

Closed
vvd170501 opened this issue Jan 16, 2021 · 1 comment
Closed

Оптимизация импортов #46

vvd170501 opened this issue Jan 16, 2021 · 1 comment

Comments

@vvd170501
Copy link
Collaborator

vvd170501 commented Jan 16, 2021

Импорты requests и bs4 в сумме занимают около 100мс и выполняются даже при запуске локальных команд (например kks run)

Тестировалось на vvd170501/kks@77f5201

$time kks run --help

import requests 0.051137447357177734
import requests 2.384185791015625e-07
import bs 0.05008339881896973
import h2t 0.002858400344848633
import requests 7.152557373046875e-07
import bs 2.384185791015625e-06
Usage: kks run [OPTIONS] [RUN_ARGS]...
...
real	0m0,192s
user	0m0,164s
sys	0m0,028s

Originally posted by @vvd170501 in #45 (comment)

Можно сделать эти импорты (и/или импорты модулей kks.ejudge и kks.ejudge_submit) более локальными (как было сделано с pkg_resources в 992caf3). Это должно ускорить запуск локальных команд

@vvd170501
Copy link
Collaborator Author

vvd170501 commented Jan 17, 2021

После переноса импортов время запуска локальных команд сокращается до 90-105мс (vvd170501/kks@85cc73d )

time kks run --help
...
real	0m0,091s
user	0m0,087s
sys	0m0,005s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant