syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.65k stars 4.89k forks source link

semantic in emacs lisp, still slow by default #12156

Closed quicknir closed 4 years ago

quicknir commented 5 years ago

There's been tons of discussions about this:

https://github.com/syl20bnr/spacemacs/issues/1907 https://github.com/syl20bnr/spacemacs/pull/7736 https://github.com/syl20bnr/spacemacs/issues/11058 https://github.com/syl20bnr/spacemacs/pull/11511

Currently, it's still the case that when you simply turn on semantic, emacs lisp becomes unbearable slow because during auto completion it seems to try to untar and parse all emacs lisp code in the entire universe.

There's been various ideas, fixes, workarounds suggested in these threads. The most promising concept AFAICS was to simply limit the scope of parsing that semantic does to try to do auto completion. This was the objective of https://github.com/syl20bnr/spacemacs/pull/7736. However, as the follow up comment notes, the merged code is not successful in achieving what it is trying to. It sets a global default for semanticdb-find-default-throttle , but this variable also has a mode local default. The following snippet makes the mode local default equal to the global one:

(use-package semantic
  :config
  (setq-mode-local emacs-lisp-mode
                   semanticdb-find-default-throttle
                   (default-value 'semanticdb-find-default-throttle)))

This does result in slightly worse auto completion, but bearable performance.

Other approaches might be adding some kind of default timeout to auto completion at a sane level.

I'm open to alternatives, but let's try to focus on getting something that makes performance bearable, to start. Most people using spacemacs aren't working on huge, complex emacs lisp projects, but they do have to use elisp to make basic configuration changes. Having unbearable performance in the editor's native config language, in an almost-out-of-the-box setup, is off putting, especially for new users. Whereas slightly worse auto completion probably isn't a big deal.

bet4it commented 5 years ago

Have a try of ab386fbbb539e7b421db5aabb2dae6aae33a2256?

duianto commented 5 years ago

The following PR is now on the develop branch: Improve the use of semantic #11511

github-actions[bot] commented 4 years ago

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!