aboutsummaryrefslogtreecommitdiff
path: root/zola-static
diff options
context:
space:
mode:
Diffstat (limited to 'zola-static')
-rw-r--r--zola-static/content/blog/emacs-garbage-collection.md17
-rw-r--r--zola-static/sass/base.scss4
2 files changed, 10 insertions, 11 deletions
diff --git a/zola-static/content/blog/emacs-garbage-collection.md b/zola-static/content/blog/emacs-garbage-collection.md
index bca0f13..14fd223 100644
--- a/zola-static/content/blog/emacs-garbage-collection.md
+++ b/zola-static/content/blog/emacs-garbage-collection.md
@@ -3,18 +3,17 @@ title = "Solving Emacs Garbage Collection Stutters"
date = 2025-05-12
+++
-The more you load Emacs up with packages, the more it starts to show its age. Throw on a theme and an lsp client, and you might start to notice frequent stuttering.
-
-This problem was very frustrating for me - I dealt with it for months, and considered quitting Emacs altogether. I want to be able to hold `C-n` and linearly move down the document, micro-stutter *free*.
+The more you load Emacs up with packages, the more it starts to chug. Throw on a theme and an lsp client, and you might start to notice frequent stuttering.
+This problem was very frustrating for me - I want to be able to hold `C-n` and linearly move down the document, micro-stutter *free*. I spent weeks searching for the problem, and considered quitting Emacs altogether.
# Garbage Collection
-It turns out that the problem wasn't that packages were executing slowly, it was the garbage that they were building up. Emacs' garbage collector waits until a byte threshold has been reached before executing.
-> This value feels relatively low for a modern computer - only `800KB`.
+It turns out that the problem wasn't that packages were executing slowly, it was the garbage that they were building up.
-Once threshold is reached the garbage collection process takes time, and causes the stutter. If you want to see just how often this triggers the GC, try setting `garbage-collection-messages` to non nil (you might be surprised how often it triggers). As with most things in Emacs, you can tune this behaviour.
+Emacs' garbage collector waits until a byte threshold (the `gc-cons-threshold` variable) has been reached before executing. Its default value feels relatively low for a modern computer - only `800KB`. This results in frequent garbage collections, each causing a small stutter. Luckily, as with most things in Emacs, you can tune this behaviour.
+> If you want to see how frequently the GC is triggered, try setting `garbage-collection-messages` to non nil (you might be surprised).
-Opinions differ.
+Opinions on the ideal solution differ.
- Some people recommend **increasing** the threshold, leading to longer times without triggering the GC but longer stutters.
- Others recommend **lowering** the threshold, causing more frequent GC triggers but smaller stutters.
- The minibuffer (especially with packages like `vertico`) can use a lot of memory, so some [recommend](https://bling.github.io/blog/2016/01/18/why-are-you-changing-gc-cons-threshold/) increasing the threshold only when using it.
@@ -35,6 +34,6 @@ I also *basically* disable the threshold entirely when in the minibuffer. Here's
(run-with-idle-timer 1.2 t 'garbage-collect)
```
-I have been using this for a few months and it's worked perfectly. I've tried my best to notice the garbage collections, I can't.
+I have been using this for a few months and it's worked perfectly. I've tried my best to notice the garbage collections, I haven't been able to.
-> There is a package which does the same thing, called [the Garbage Collector Magic Hack](https://github.com/emacsmirror/gcmh). Personally I prefer a lower idle time, and keeping it in my own config.
+> There is a package for this, called [the Garbage Collector Magic Hack](https://github.com/emacsmirror/gcmh). Personally I prefer a lower idle time than its default, and I like keeping it in my own config.
diff --git a/zola-static/sass/base.scss b/zola-static/sass/base.scss
index d3803d4..f802259 100644
--- a/zola-static/sass/base.scss
+++ b/zola-static/sass/base.scss
@@ -74,8 +74,8 @@ blockquote p {
p code {
background: #171615;
- padding-left: 0.5rem;
- padding-right: 0.5rem;
+ padding-left: 0.25rem;
+ padding-right: 0.25rem;
font-family: monospace;
}