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

Speed up import time #5719

Merged
merged 7 commits into from
Jun 8, 2023
Merged

Speed up import time #5719

merged 7 commits into from
Jun 8, 2023

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented May 17, 2023

The main focus is to get the import time down. Done with python -X importtime -c "import holoviews" 2> log.txt && tuna log.txt

For now, I have moved IPython, Ibis, and Panel to be lazy imports.

Current main (taking 1.256 seconds to load):
image

With this PR (takes 0.338 seconds to load):
image

@codecov-commenter
Copy link

codecov-commenter commented May 17, 2023

Codecov Report

Merging #5719 (ad2575b) into main (f4c4c12) will increase coverage by 0.00%.
The diff coverage is 92.85%.

@@           Coverage Diff           @@
##             main    #5719   +/-   ##
=======================================
  Coverage   88.24%   88.24%           
=======================================
  Files         304      305    +1     
  Lines       62680    62693   +13     
=======================================
+ Hits        55309    55324   +15     
+ Misses       7371     7369    -2     
Impacted Files Coverage Δ
holoviews/__init__.py 70.49% <66.66%> (+2.69%) ⬆️
holoviews/core/data/ibis.py 81.56% <94.44%> (+0.80%) ⬆️
holoviews/ipython/__init__.py 75.92% <100.00%> (+0.30%) ⬆️
holoviews/tests/util/test_init.py 100.00% <100.00%> (ø)
holoviews/util/__init__.py 74.68% <100.00%> (ø)

... and 1 file with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@philippjfr
Copy link
Member

Only question from my side is why you had to make IPython imports lazy in holoviews.ipython if you already made the holoviews.ipython import dependent on whether IPython is in sys.modules.

@hoxbro
Copy link
Member Author

hoxbro commented Jun 8, 2023

Good catch. I think I made those changes before I added the sys.module change. I have reverted it now.

@hoxbro hoxbro merged commit e9bccda into main Jun 8, 2023
@hoxbro hoxbro deleted the speedup_import branch June 8, 2023 13:27
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants