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

perf(cli): speed up #2934

Merged
merged 1 commit into from
Aug 25, 2022
Merged

perf(cli): speed up #2934

merged 1 commit into from
Aug 25, 2022

Conversation

aarnphm
Copy link
Member

@aarnphm aarnphm commented Aug 24, 2022

This PR speeds up CLI performance by 100ms

Tested with hyperfine with 3 rounds of warmup and 1000 runs.

This PR also refactor some of the utilities functions that is only used by bentoml_cli
to bentoml_cli folder, which also helps with import speeds

This PR also add a regression tests to make sure that in the future, if we accidentally
introduce a heavy imports, we will be able to catch it.

@aarnphm aarnphm requested review from ssheng, parano and a team as code owners August 24, 2022 19:05
@aarnphm aarnphm requested review from larme and removed request for a team August 24, 2022 19:05
@codecov
Copy link

codecov bot commented Aug 24, 2022

Codecov Report

Merging #2934 (8f4a117) into main (901256c) will increase coverage by 0.89%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2934      +/-   ##
==========================================
+ Coverage   69.88%   70.78%   +0.89%     
==========================================
  Files         121      104      -17     
  Lines        9961     9473     -488     
==========================================
- Hits         6961     6705     -256     
+ Misses       3000     2768     -232     
Impacted Files Coverage Δ
bentoml/_internal/frameworks/torchscript.py 0.00% <0.00%> (-95.92%) ⬇️
bentoml/_internal/frameworks/common/pytorch.py 0.00% <0.00%> (-72.64%) ⬇️
bentoml/_internal/runner/strategy.py 83.05% <0.00%> (-8.48%) ⬇️
bentoml/_internal/runner/runner_handle/local.py 76.00% <0.00%> (-8.00%) ⬇️
bentoml/_internal/models/model.py 88.07% <0.00%> (-1.76%) ⬇️
bentoml/_internal/runner/runner.py 90.90% <0.00%> (-0.91%) ⬇️
bentoml/__init__.py
bentoml/tensorflow.py
bentoml/serve.py
bentoml/mlflow.py
... and 13 more

Signed-off-by: Aaron Pham <29749331+aarnphm@users.noreply.github.com>
@sauyon sauyon merged commit 1f043d2 into bentoml:main Aug 25, 2022
@aarnphm aarnphm deleted the fix/imports_cli branch August 25, 2022 16:52
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

Successfully merging this pull request may close these issues.

None yet

3 participants