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

When enable semantic in emacs-lisp buffer, the completion is very slow #1907

Closed
zilongshanren opened this issue Jun 9, 2015 · 22 comments
Closed

Comments

@zilongshanren
Copy link
Contributor

If I enable semantic layer or manually enable semantic mode, the company mode completion is very very slow when editing elisp code. It will try to parse all the elisp in Emacs installation and ELPA directory.

And even in elisp comments, the company tries to use company-capf as the backend.
If I disable semantic layer, it will use company-dabbrev when completing comments.

@tuhdo
Toughts?

@tuhdo
Copy link
Contributor

tuhdo commented Jun 9, 2015

company-capf is the expected backend to be used. I had no slowness with it. Could you describe how is it slow? And even without semantic-mode enabled, in Emacs Lisp company should use company-capf. Do you set company-idle-delay to very small value?

@zilongshanren
Copy link
Contributor Author

@tuhdo
Yes, I set company-idle-delay to 0.08. I know company-capf is the right backend, but it should only be used when completing lisp code not the comments in lisp.

When wrting comments in lisp, it should use company-dabbrev as the default backend.

@a13ph
Copy link

a13ph commented Jun 25, 2016

This affects me, despite me having default Spacemacs setup for auto-completion and semantic layers (i didn't specifically enable company anywhere so IDK if i have it enabled in elisp files or not).
I really want to use semantic, but this is making it very troublesome. (yes, this issue is only with semantic enabled)

I'm not even mad at it parsing all the emacs sources, I'm just mad it's doing it when I'm typing and not doing when I'm not, when it's clearly better to do so the other way around 😆
Any hope of parsing while idle to build some sort of cache/index? Or do I have to run some tag tool somewhere?

@mrkgnao
Copy link

mrkgnao commented Oct 14, 2016

I have this issue too, and it'd be great if a manual tagging procedure of the kind @a13ph describes exists. With semantic enabled, elisp-mode is barely usable.

@NOBLES5E
Copy link

NOBLES5E commented Feb 9, 2017

I have this issue too. Any plan to solve this?

@a13ph
Copy link

a13ph commented Feb 13, 2017

@d12frosted, can you please reopen this issue then?

@btljuice
Copy link

I have the same issue also on my end, when auto-completing in my .spacemacs file:

  • With both the semantics and auto-completion layer, the auto-completion is quite slow after typing two letters. The bottom status bar describes some parsing effort in what appears to be all my *.el files for my layers.
  • Without the semantics layer, auto-completion is "virtually" w/o any delay.

I have disabled semantics since I don't use it very much. On my end I'm fine like that, but I'm willing to help / debug / support if needed.


System Info 💻

  • OS: windows-nt
  • Emacs: 25.1.1
  • Spacemacs: 0.200.7
  • Spacemacs branch: master (rev. c2774bc)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(helm
 (auto-completion :variables auto-completion-return-key-behavior nil auto-completion-tab-key-behavior nil auto-completion-enable-snippets-in-popup t auto-completion-enable-help-tooltip t)
 smex cscope gtags
 (shell :variables shell-default-height 16 shell-default-position 'bottom shell-default-shell 'shell)
 (spell-checking :variables spell-checking-enable-by-default nil)
 (syntax-checking :variables syntax-checking-enable-by-default nil)
 typography version-control git perforce dash evil-snipe vinegar
 (ibuffer :variables ibuffer-group-buffers-by 'projects)
 ranger imenu-list markdown org org-clock-csv finance emacs-lisp common-lisp latex c-c++ java python lua shell-scripts windows-scripts autohotkey vimscript csv restclient html javascript)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS MODULES

@braham-snyder
Copy link
Contributor

does your semanticdb-find-default-throttle include omniscience? if so, this may fix it: #7736 (comment)

@d12frosted d12frosted reopened this Jul 26, 2017
@d12frosted
Copy link
Collaborator

@a13ph I am the master of timing, right?

delaanthonio added a commit to delaanthonio/spacemacs that referenced this issue Aug 3, 2017
Resolve syl20bnr#1907.

Emacs 25 sets semanticdb-find-default-throttle as a mode-local variable in
emacs-lisp-mode and includes the omniscient throttle which slows down indexing.
Let's override the mode-local variable so it doesn't include the omniscient
throttle.

See syl20bnr#7736 for additional context.
delaanthonio added a commit to delaanthonio/spacemacs that referenced this issue Aug 4, 2017
Resolve syl20bnr#1907.

Emacs 25 sets semanticdb-find-default-throttle as a mode-local variable in
emacs-lisp-mode and includes the omniscient throttle which slows down indexing.
Let's override the mode-local variable so it doesn't include the omniscient
throttle.

See syl20bnr#7736 for additional context.
@agzam
Copy link
Contributor

agzam commented Oct 11, 2017

Any update on this issue? Even (semantic :disabled-for '(emacs-lisp)) seems to be not working

@braham-snyder
Copy link
Contributor

judging from @beta1440's PR, my suggestion in #7736 (comment) worked for him -- can you confirm whether that works?

@agzam
Copy link
Contributor

agzam commented Oct 12, 2017

@braham-snyder it seems it did stop forcing company.el to parse big number of files, but there's still noticeable lag (about half a second long) there and there. Sigh. I guess I have to disable semantic layer. Nothing else seems to work for this issue.

@agzam
Copy link
Contributor

agzam commented Oct 12, 2017

nope, I was wrong... it actually still tries to parse bunch of files, when something being typed in elisp docstings.

@kkweon
Copy link

kkweon commented Feb 17, 2018

Any update on how to fix this?

In the mini-buffer, it says parsing **/*.el every time I type a string and I can't type anything while parsing, which takes forever parsing all *.el.

image

@braham-snyder
Copy link
Contributor

FWIW, #7736 (comment) is still working for me

@NightMachinery
Copy link

NightMachinery commented Mar 24, 2018

This needs a fix IMO? A caching system?
#7736 (comment) seems to work but it is just a workaround and it probably disables good features.

@josiah14
Copy link

josiah14 commented May 27, 2018

I do have to say, for an editor configured and (mostly) written in Emacs Lisp, it's a little unnerving that it has this much trouble with its native language going on 3 years, now. I'm finally taking the time to try to learn Emacs Lisp, and this particular issue is almost enough for me to give up on it and use other editors for the language layers that don't work well enough for me.

@NightMachinery
Copy link

NightMachinery commented May 27, 2018 via email

@ghost
Copy link

ghost commented Aug 31, 2018

#11058 (comment) fixed this issue for me (and also #11058).

@quicknir
Copy link
Contributor

Is there any resolution for this?

@duianto
Copy link
Collaborator

duianto commented May 4, 2019

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

@github-actions
Copy link

github-actions bot commented May 3, 2020

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!

@github-actions github-actions bot added the stale marked as a stale issue/pr (usually by a bot) label May 3, 2020
@github-actions github-actions bot closed this as completed Aug 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.