Closed dsedivec closed 3 years ago
I experience the same lag you mention w Company and Elisp buffers. Havent had a chance to look into it, but what you mention here makes sense
I'll look into this ASAP. I'm sure there's a way to avoid the long symbols.
Hashing the recipe makes sense and actually seems to decrease start up time (marginally) on my system.
I've got a patch on my fork which does so and it seems to solve the issue with Company completion.
You can try it via straight-bug-report
if you like:
(straight-bug-report
:user-dir "hash-transaction-symbol.straight"
:interactive t
:pre-bootstrap
(setq straight-repository-user "progfolio"
straight-repository-branch "fix/transaction-symbols")
:post-bootstrap
(setq completion-styles '(flex))
(straight-use-package 'company))
That should open a child Emacs process which will have straight and Company installed and the flex completion style set. You can test within that environment.
I'll have to look over the transaction system more closely, but I believe these symbols may only need to last as long as a transaction. If that's true, we can unintern them at the end of a transaction as well. Will look into that ASAP.
Hashing the recipe makes sense and actually seems to decrease start up time (marginally) on my system. I've got a patch on my fork which does so and it seems to solve the issue with Company completion. You can try it via
straight-bug-report
if you like:
Tested here and indeed flex completion seems fast again! (Also, straight-bug-report
is 🔥.)
I'll have to look over the transaction system more closely, but I believe these symbols may only need to last as long as a transaction. If that's true, we can unintern them at the end of a transaction as well. Will look into that ASAP.
Great, I was wondering whether straight could unintern
those as well. Fewer symbols to search always helps. 😃
Thank you for looking at this!
Glad to hear that's the case.
(Also, straight-bug-report is fire.)
Thank you. It's been an incredibly helpful tool. I have plans of making a separate, generic package that does something similar in the future.
I was wondering whether straight could unintern those as well. Fewer symbols to search always helps.
Yes, that definitely seems like the right thing to do to me. Especially considering we're using the "use-package" prefix. I've added code to unintern them at the end of each transaction. From my reading of the transaction system, I believe this is safe. I've merged the change into the "develop" branch for now so @raxod502 can have chance to look the change over. If you're not already using that branch, you can switch with:
(setq straight-repository-branch "develop")
Prior to straight's bootstrap code in your init file.
Thank you for looking at this!
Thank you for the thorough report. I had sluggish Company mode on my TODO list for quite some time, but it was never high priority. Didn't even consider straight might be causing that slowdown. I'll have to integrate more completion into my workflow now.
As always, testing is appreciated.
Dang, that's pretty wild as an unintended consequence. Thank you @dsedivec for the report and @progfolio for the fix. I think your change makes perfect sense, it should be fine to unintern those symbols at the end of the transaction.
What's wrong
I noticed very slow flex completion and I think I traced it back to very long symbols created by straight.el. For example, one such symbol:
use-package-\(:type\ git\ :flavor\ melpa\ :files\ \(\"*groovy*\.el\"\ \"groovy-mode-pkg\.el\"\)\ :host\ github\ :repo\ \"Groovy-Emacs-Modes/groovy-emacs-modes\"\ :package\ \"groovy-mode\"\ :local-repo\ \"groovy-emacs-modes\"\)-nil-nil
Directions to reproduce
emacs -q
completion-styles
:(setq completion-styles '(flex))