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

* layers/+lang/python/*: New flag python-enable-importmagic #16752

Merged

Conversation

sunlin7
Copy link
Contributor

@sunlin7 sunlin7 commented Dec 24, 2024

Spacemacs slow on opening a single *.py file.

I figured out the top performance killer for python layer are importmagic and pyvenv.
The importmagic will start a background server to process the requests from importmagic, it took ~0.5 seconds on my local; but acctually I rarely using the importmagic feature.

This PR introduce a toggle flag python-enable-importmagic to give chance to disable this heavy feature.

PS: For pyvenv performance issue (leads Spacemacs slow when opening a *.py), I had an upstream PR, but it seems the project stop update for 3 years.
jorgenschaefer/pyvenv#128

Copy link
Collaborator

@bcc32 bcc32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, thank you for all of your recent investigation into spacemacs's performance!

Do you think we should maybe leave this on by default? We should weigh the cost of confusing users with silent behavior changes. Certainly if we change the default behavior I think we should make that clear in the PR title, description, and commit messages.

@sunlin7 sunlin7 force-pushed the python-layer-speedup-importmagic branch from 7881763 to fcfb44d Compare December 29, 2024 17:01
@sunlin7
Copy link
Contributor Author

sunlin7 commented Dec 29, 2024

Sure, I use Spacemacs for daily works, and really suffered by the slow performance for just opening a single *.py file :)

I had change the default value to t to not make a surprise for the users who're using the importmagic feature; and added a section on the document for users how to get performance benefit when they using the importmagic feature.

Please help review again. Thank you.

@smile13241324 smile13241324 merged commit 844b510 into syl20bnr:develop Dec 31, 2024
8 of 9 checks passed
@smile13241324
Copy link
Collaborator

Thanks for all the work guys :). Given that importmagic and epc are depreciated for a long time, and are really costly background processes I would disable them by default.

@sunlin7
Copy link
Contributor Author

sunlin7 commented Dec 31, 2024

Thank you so much!

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.

3 participants