Closed synic closed 3 years ago
@synic I cannot reproduce your issue. I have opened below test file in python mode with lsp enabled:
""" Very simple test file """
def say(text: str) -> None:
""" This prints what you tell it """
print(text)
def add_eggs(text: str) -> str:
""" This adds some eggs """
return " ".join([text, "eggs"])
def do_nothing_eggs(text: str, text2: str, text3: str) -> str:
""" This adds some eggs """
return " ".join([text, "eggs"])
say(add_eggs("I love my spam with"))
Then I have pressed ,vw
and measured how long displaying helm takes. Then I have chosen the first virtualenv and measured how long applying it took.
Basically both did take less than 3 seconds, which is pretty much ok on my old linux laptop. Can you update all your packages and spacemacs to the latest version and post whether the issue persists? Also it would be interesting if the issue also happens with the latest released emacs version 26.3.
I would especially be interested in the python version you are using. I am on 3.8.1.
My system config is here:
((lsp :variables lsp-navigation 'peek lsp-ui-doc-enable nil)
dap
(dart :variables dart-backend 'lsp lsp-dart-sdk-dir "~/Downloads/dart-sdk/")
helm notmuch
(scala :variables scala-backend 'scala-metals)
nim spacemacs-purpose elasticsearch
(yang :variables yang-pyang-rules "ietf")
ietf scheme
(auto-completion :variables auto-completion-return-key-behavior 'complete auto-completion-tab-key-behavior 'cycle auto-completion-complete-with-key-sequence nil auto-completion-complete-with-key-sequence-delay 0.1 auto-completion-idle-delay 0.2 auto-completion-private-snippets-directory nil auto-completion-enable-snippets-in-popup nil auto-completion-enable-help-tooltip t auto-completion-use-company-box nil auto-completion-enable-sort-by-usage t)
syntax-checking better-defaults
(clojure :variables clojure-enable-fancify-symbols t clojure-enable-sayid t clojure-enable-clj-refactor t clojure-enable-linters
'(clj-kondo joker))
gpu graphviz
(plantuml :variables plantuml-jar-path "~/.plantuml/plantUml.jar" org-plantuml-jar-path "~/.plantuml/plantUml.jar")
salt ibuffer emacs-lisp pdf
(org :variables org-want-todo-bindings t org-enable-github-support t org-enable-bootstrap-support t org-enable-reveal-js-support t org-enable-hugo-support t org-enable-trello-support t org-enable-epub-support t org-enable-sticky-header nil)
(shell :variables shell-enable-smart-eshell nil shell-default-shell 'vterm shell-default-height 30 shell-default-position 'bottom shell-default-full-span nil shell-default-term-shell "/usr/bin/fish")
version-control import-js
(cmake :variables cmake-enable-cmake-ide-support t)
(c-c++ :variables c-c++-default-mode-for-headers 'c++-mode c-c++-backend 'lsp-clangd c-c++-lsp-enable-semantic-highlight 'rainbow c++-enable-organize-includes-on-save t c-c++-lsp-semantic-highlight-method 'overlay c-c++-enable-clang-format-on-save t c-c++-adopt-subprojects t c-c++-enable-auto-newline t)
web-beautify semantic templates epub themes-megapack git github sml bm
(copy-as-format :variables copy-as-format-default "markdown" copy-as-format-asciidoc-include-file-name t)
pass common-lisp
(python :variables python-backend 'lsp python-lsp-server 'pyls python-test-runner 'pytest python-formatter 'lsp python-format-on-save t python-save-before-test t python-sort-imports-on-save t)
windows-scripts jr
(shell-scripts :variables shell-scripts-backend 'lsp)
prodigy emoji
(markdown :variables markdown-live-preview-engine 'vmd)
bibtex
(json :variables json-fmt-tool 'web-beautify json-fmt-on-save t)
debug
(latex :variables latex-enable-auto-fill t latex-enable-magic nil latex-enable-folding t)
lua html
(javascript :variables javascript-import-tool 'import-js javascript-backend 'lsp javascript-fmt-tool 'web-beautify javascript-repl 'nodejs js2-basic-offset 2 js-indent-level 2)
react
(yaml :variables yaml-enable-lsp t)
prettier
(multiple-cursors :variables multiple-cursors-backend 'evil-mc)
nginx
(docker :variables docker-dockerfile-backend 'lsp)
csv search-engine
(restclient :variables restclient-use-org t)
restructuredtext selectric octave purescript speed-reading systemd imenu-list
(java :variables java-backend 'lsp)
groovy
(go :variables go-backend 'lsp go-use-golangci-lint t gofmt-command "goimports" go-tab-width 4 go-format-before-save t go-use-gocheck-for-testing t go-use-test-args "-race -timeout 10s" godoc-at-point-function 'godoc-gogetdoc)
coq django
(elm :variables elm-sort-imports-on-save t elm-format-on-save t)
kubernetes idris
(haskell :variables haskell-completion-backend 'lsp haskell-enable-hindent t haskell-process-type 'stack-ghci)
pandoc sphinx parinfer asciidoc
(treemacs :variables treemacs-use-follow-mode t treemacs-use-filewatch-mode t treemacs-collapse-dirs 3 treemacs-use-git-mode 'deferred)
ansible puppet rust hy xkcd typography vimscript
(terraform :variables terraform-auto-format-on-save t)
(ruby :variables ruby-enable-enh-ruby-mode t ruby-backend 'lsp)
ruby-on-rails asm
(sql :variables sql-capitalize-keywords t)
perl6 autohotkey
(elixir :variables flycheck-elixir-credo-strict t elixir-backend 'lsp)
faust vagrant erlang
(dash :variables helm-dash-docset-newpath "~/.local/share/Zeal/Zeal/docsets")
games php helpful nginx racket
(colors :variables colors-colorize-identifiers 'all)
d
(typescript :variables typescript-backend 'lsp typescript-fmt-tool 'tide typescript-lsp-linter t typescript-linter 'tslint typescript-fmt-on-save t))
Not sure if this is related to your problem, but I disabled spacemacs//python-setup-shell
and that improved the start-up time for pyvenv-activate
/pyvenv-workon
. Naturally, that function does some useful stuff, so that's not exactly a "solution".
From what I could tell, the call to ipython --version
can be quite slow (e.g. possibly related to this), and, because spacemacs//python-setup-shell
will call that indiscriminately (itself called as advice on pyvenv-activate
), simple venv changes can take a while.
Try timing ipython --version
(if that's the configured Python executable, of course) at the command line.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!
Description :octocat:
pyvenv-workon takes over 30 seconds to run, even on a brand new virtualenv
Reproduction guide :beetle:
mkvirtualenv testing
(pyvenv-workon "testing")
Observed behaviour: :eyes: :broken_heart: I timed it. On my brand new Macbook Pro, i7, 32GB of ram, it takes over 30 seconds to activate.
Expected behaviour: :heart: :smile: Activation should be much faster. Especially for a brand new virtualenv with no code in it or packages installed.
System Info :computer: