reddit / emacs

small hiccups

CrispyBoye · 2022-08-15 16:08
Does anyone experience rare hiccups using emacs. For example maybe once a day when writing, the cursor or a command might freeze for a second. I know it's really nothing major, just bothers me a bit and i'm wondering if this is a common occurrence with emacs or is it just my system. It can happen more often when folding-unfolding headers in an org file, just a small delay (~1sec) at random, for the action to perform. Not searching for the magic solution, just wanted to see if it is just me or if i might be doing something wrong. Thanks for taking the time to read this. P.S. My config is really minimal, just the colorscheme, ivy, haskell mode, yasnippet, auctex and my key maps. Also my pc is 7 yo but its more than capable of running intense tasks, and i think vanilla Emacs isn't one of them.
nv-elisp · 2022-08-15 16:59
It's possible that something is being lazily loaded the first time you execute a command. It's possible that garbage collection is being performed. It's possible that the code being executed performs poorly in your circumstance. etc. Asking "Has anyone else had performance issues with Emacs" is too vague. It's being used in many different ways, across many different versions, on many different machines. The only meaningful way to diagnose your problem is to find a way to reproduce the performance regression and profile it. You can do this by running `profiler-start`, triggering the hiccup, then `profiler-stop` followed `profiler-report`. That will at least help you narrow down where the issue may be. Suggested reading: https://www.gnu.org/software/emacs/manual/html_node/elisp/Profiling.html
digikar · 2022-08-15 17:34
Are you... sure it's emacs and not your cognitive system :D? I mean there is [a phenomena wherein the clock's second hand seems to freeze for a moment just after you look at it](https://en.m.wikipedia.org/wiki/Chronostasis), and it has something to do with how we (our cognitive system) perceives time. If it's emacs, one reason could be the GC
CrispyBoye · 2022-08-15 18:11
Hahahahah it's definitely not the cognitive system i can asure you of that. Thanks for the insight
CrispyBoye · 2022-08-15 18:12
Thank you so much, that's what i was looking for!! I guess the only problem is that the hiccup would have to be triggered. Sometimes it can go 2 days without a hiccup.
MitchellMarquez42 · 2022-08-15 18:41
I get these on windows when using LSP-mode. Totally anecdotal though.
CrispyBoye · 2022-08-15 18:47
The funny part is that i do not using something more heavy like an lsp or a completion engine, so it really makes no sense, when vscodium runs flawlessly for an *lectron app. Plus I'm using fedora so no wind*ws shenanigans.
graduale · 2022-08-15 19:13
Maybe this can help? https://github.com/lastquestion/explain-pause-mode
CrispyBoye · 2022-08-15 19:26
I'll check it out, thanks for your contribution!!
hkjels · 2022-08-17 07:40
Garbage collection is a likely culprit. If you set the threshold too high, you will see some hiccups now and then. Could also happen if you set it too low and a package is doing a lot of work. To have Emacs garbage-collect when idle, you can use the package "gcmh" and also try setting the gc-cons-threshold to a couple of MiB 🤞🏻
deaddyfreddy · 2022-08-17 16:53
In my case the freezing was GC, but when I tried https://gitlab.com/koral/gcmh - it worked well without any tweaks, but your experience may differ.