aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJackJ30 <jackqjamison@gmail.com>2025-05-13 01:51:16 -0400
committerJackJ30 <jackqjamison@gmail.com>2025-05-13 01:51:16 -0400
commit9d84f5c4a187a41e4eba954018c9e9b9fcc46d2e (patch)
tree34343c2f06e416fe25c8ee6cb19ded1a3ba00382
parent8b5d0b19659b35b7d2433a25a22d188ecbeecddd (diff)
emacs article
-rw-r--r--zola-static/config.toml2
-rw-r--r--zola-static/content/about-me.md10
-rw-r--r--zola-static/content/about-this-site.md8
-rw-r--r--zola-static/content/blog/emacs-garbage-collection.md40
-rw-r--r--zola-static/sass/base.scss57
-rw-r--r--zola-static/static/.gitpreserve0
-rw-r--r--zola-static/static/images/portrait.jpgbin0 -> 2940276 bytes
-rw-r--r--zola-static/templates/base.html2
-rw-r--r--zola-static/templates/blog-page.html8
-rw-r--r--zola-static/templates/index.html4
10 files changed, 105 insertions, 26 deletions
diff --git a/zola-static/config.toml b/zola-static/config.toml
index b5a0879..b813603 100644
--- a/zola-static/config.toml
+++ b/zola-static/config.toml
@@ -14,4 +14,4 @@ highlight_code = true
highlight_theme = "nyx-bold"
[extra]
-# Put all your custom variables here
+# Put all your custom variables here \ No newline at end of file
diff --git a/zola-static/content/about-me.md b/zola-static/content/about-me.md
index 13b4889..9eef574 100644
--- a/zola-static/content/about-me.md
+++ b/zola-static/content/about-me.md
@@ -3,4 +3,12 @@ title = "About Me"
template = "main-page.html"
+++
-My name is Jack Jamison
+My name is Jack Jamison. I'm an American software engineer studying at the [Rensselaer Polytechnic Institute](https://www.rpi.edu) in New York. I've been programming since I was a little kid.
+
+I enjoy GPU programming, cross-platform desktop application design, build systems, game development, and system administration. I'm also interested in operating systems and networking, but I haven't pursued them yet.
+
+I use Emacs as my text editor. I've spent a lot of time configuring it. If you want, you can check out my [dotfiles](https://github.com/JackJ30/dotfiles).
+
+If you want to talk to me, I would love to also. Feel to reach out at my [email](mailto:jackqjamison@gmail.com).
+
+![Handsome devil](/images/portrait.jpg)
diff --git a/zola-static/content/about-this-site.md b/zola-static/content/about-this-site.md
index ec41a95..b8b6499 100644
--- a/zola-static/content/about-this-site.md
+++ b/zola-static/content/about-this-site.md
@@ -3,4 +3,10 @@ title = "About This Site"
template = "main-page.html"
+++
-This site is generated with [zola](https://getzola.org).
+# About this website
+- The pages are generated from markdown files with [Zola](https://getzola.org).
+- I use [Nginx](https://https://nginx.org/) as my web server.
+- It is hosted on [Vultr](https://www.vultr.com/).
+- [Epik](https://epik.com) is my domain registrar.
+
+There are no ads or trackers on this site. The source code is available on [github](https://github.com/JackJ30/jackjamison.xyz).
diff --git a/zola-static/content/blog/emacs-garbage-collection.md b/zola-static/content/blog/emacs-garbage-collection.md
new file mode 100644
index 0000000..1784be9
--- /dev/null
+++ b/zola-static/content/blog/emacs-garbage-collection.md
@@ -0,0 +1,40 @@
++++
+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*.
+
+
+# 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`.
+
+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.
+
+Opinions 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.
+
+# The Solution
+In my opinion, the best solution is to garbage collect **when idle**. When editing, you're often pausing briefly - and if there is little garbage, Emacs can collect it very quickly.
+I also *basically* disable the threshold entirely when in the minibuffer. Here's the code from my `init.el`.
+
+```lisp
+(defun my-minibuffer-setup-hook ()
+ (setq gc-cons-threshold most-positive-fixnum))
+
+(defun my-minibuffer-exit-hook ()
+ (setq gc-cons-threshold 800000000))
+
+(setq gc-cons-threshold most-positive-fixnum)
+
+(run-with-idle-timer 1.2 t 'garbage-collect)
+```
+
+I have been using this for a few months and it's worked perfectly. Even when I try my best to notice the garbage collection, I can't.
+
+> 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.
diff --git a/zola-static/sass/base.scss b/zola-static/sass/base.scss
index 8090930..7b84bb8 100644
--- a/zola-static/sass/base.scss
+++ b/zola-static/sass/base.scss
@@ -1,22 +1,19 @@
-* {
- font-family: monospace;
-}
-
body {
background-color: #252422;
margin: 0;
padding: 0;
+ font-family: arial;
}
body section {
height: 100%;
- max-width: 75rem;
+ max-width: 55rem;
margin-inline: auto;
padding: 1rem;
background-color: #252422;
color: #F3E9DC;
- font-size: 125%;
+ font-size: 115%;
}
// text sizing
@@ -30,7 +27,7 @@ ul {
p {
margin-top: 0.5rem;
- margin-bottom: 0.5rem;
+ margin-bottom: 1.2rem;
}
a {
@@ -41,25 +38,38 @@ h1 a {
text-decoration: none;
}
-pre {
- padding : 0.5rem;
- border-radius: 0.3rem;
- overflow: auto;
- tab-size: 4;
-}
-
.header-title {
margin-bottom: 0;
font-size: 2.5rem;
}
+.blog-header {
+ display: flex;
+ justify-content: space-between;
+}
+
+.blog-header-left {
+ padding-right: 1rem;
+ flex: 1 1 auto;
+ max-width: 60%;
+}
+
+.blog-header-right {
+ flex: 0 0 auto;
+ white-space: nowrap;
+ text-align: right;
+}
+
.subtitle {
margin: 0.5rem auto;
}
-.header-container {
- display: flex;
- justify-content: space-between;
+pre {
+ padding : 0.5rem;
+ border-radius: 0.3rem;
+ overflow: auto;
+ tab-size: 4;
+ font-family: monospace;
}
.footer-text {
@@ -78,3 +88,16 @@ blockquote p {
margin-top: 0.2rem;
margin-bottom: 0.2rem;
}
+
+p code {
+ background: #171615;
+ padding-left: 0.5rem;
+ padding-right: 0.5rem;
+ font-family: monospace;
+}
+
+img {
+ width: 40rem;
+ display: block;
+ margin: 0 auto;
+}
diff --git a/zola-static/static/.gitpreserve b/zola-static/static/.gitpreserve
deleted file mode 100644
index e69de29..0000000
--- a/zola-static/static/.gitpreserve
+++ /dev/null
diff --git a/zola-static/static/images/portrait.jpg b/zola-static/static/images/portrait.jpg
new file mode 100644
index 0000000..85fd2e4
--- /dev/null
+++ b/zola-static/static/images/portrait.jpg
Binary files differ
diff --git a/zola-static/templates/base.html b/zola-static/templates/base.html
index 9aa47d8..7eb1914 100644
--- a/zola-static/templates/base.html
+++ b/zola-static/templates/base.html
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
- <title>Jack Jamison</title>
+ <title>{% block title %}Jack Jamison{% endblock title %}</title>
<link rel="stylesheet" href="/base.css">
</head>
diff --git a/zola-static/templates/blog-page.html b/zola-static/templates/blog-page.html
index 8e2fa3d..ed1afeb 100644
--- a/zola-static/templates/blog-page.html
+++ b/zola-static/templates/blog-page.html
@@ -1,14 +1,16 @@
{% extends "base.html" %}
+{% block title %}{{ page.title }}{% endblock title %}
+
{% block header %}
-<div class="header-container">
- <div>
+<div class="blog-header">
+ <div class="blog-header-left">
<h1 class="header-title">
{{ page.title }}
</h1>
<p class="subtitle"><strong>{{ page.date }}</strong> {% if page.updated %} <small>(updated {{ page.updated }})</small> {% endif %}</p>
</div>
- <div>
+ <div class ="blog-header-right">
<h1 class="header-title"><a href="{{ config.base_url }}">Jack Jamison</a></h1>
</div>
</div>
diff --git a/zola-static/templates/index.html b/zola-static/templates/index.html
index f674f13..4ef333d 100644
--- a/zola-static/templates/index.html
+++ b/zola-static/templates/index.html
@@ -8,12 +8,12 @@
</ul>
<h2>Articles</h2>
<ul>
- <li><p><a href="{{ get_url(path='@/blog/_index.md') }}"></a></p></li>
+ <li><p><a href="{{ get_url(path='@/blog/emacs-garbage-collection.md') }}">Solving Emacs Garbage Collection Stutters</a></p></li>
</ul>
<h2>Links</h2>
<ul>
<li><p><a href="https://github.com/JackJ30">GitHub</a></p></li>
- <li><p><a href="https://jackj30.github.io">Old portfolio</a></p></li>
+ <li><p><a href="https://jackj30.github.io">(Archive) old portfolio</a></p></li>
</ul>
<hr>
<p class="footer-text"><a href="{{ get_url(path='@/blog/_index.md') }}">All articles sorted by date</a></p>