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

Lazy import of pandas #19

Open
danielhollas opened this issue Mar 12, 2024 · 2 comments
Open

Lazy import of pandas #19

danielhollas opened this issue Mar 12, 2024 · 2 comments

Comments

@danielhollas
Copy link

danielhollas commented Mar 12, 2024

This is a low-hanging fruit for speeding up the import of ipyoptimade package.

pandas is currently imported only in src/ipyoptimade/subwidgets/output_summary.py

I've already done the same in AWB, so this win should directly translate into faster app load speed. (locally I see ~200ms difference, would probably be bigger in the Demo container).

cc @superstar54 @unkcpz

For reference, I benchmark the import time with

pipx install tuna
python -Ximporttime -c "import ipyoptimade" 2> importtime.out
tuna importtime.out

To get this

image

@danielhollas
Copy link
Author

I'll just note that the next big offender is optimade.models.

image

I suspect (but did not verify) that this is due to pydantic models. I wonder if using the defer_build option, as discussed here would improve that. But that would have to be made in the optimade package.

@unkcpz
Copy link
Member

unkcpz commented Mar 13, 2024

Okay, cool! Let's do pandas first. BTW, the performance test by @superstar54 was did with old aiida-core 2.4 without your performance improvements.

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

2 participants