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

Premature imports in version 2.5.0 #507

Closed
vsemionov opened this issue Dec 7, 2022 · 3 comments
Closed

Premature imports in version 2.5.0 #507

vsemionov opened this issue Dec 7, 2022 · 3 comments
Labels
Contributions welcome Help on this would be much appreciated good first issue

Comments

@vsemionov
Copy link

Matplotlib and Seaborn are imported unconditionally by sql explorer, even if charts are disabled in the settings. As a result, these libraries are imported every time our Django application starts up. This increases the memory consumption of our server and some long-running management commands. We only have Matplotlib installed (not Seaborn), and see about 50 MB more memory used.

Additionally, the following is now scattered in our daily maintenance logs and email reports:

[38:MainThread] [none] [matplotlib.font_manager] INFO: generated new fontManager

The above is also a result of Matplotlib initialization on a pristine filesystem.

Can we please import the chart-related libraries only if charts are enabled in settings?

@marksweb marksweb added Contributions welcome Help on this would be much appreciated good first issue labels Dec 8, 2022
@lawson89
Copy link
Contributor

@marksweb @vsemionov please review this change and let me know

@marksweb
Copy link
Collaborator

That looks sensible to me. Thanks @lawson89

@vsemionov
Copy link
Author

Looks good, thank you @lawson89

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Contributions welcome Help on this would be much appreciated good first issue
Projects
None yet
Development

No branches or pull requests

3 participants