<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Memory-Optimization on David R. Longnecker - Converting Coffee to Code</title><link>https://drlongnecker.com/tags/memory-optimization/</link><description>Recent content in Memory-Optimization on David R. Longnecker - Converting Coffee to Code</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 07 Apr 2026 09:00:00 -0600</lastBuildDate><atom:link href="https://drlongnecker.com/tags/memory-optimization/index.xml" rel="self" type="application/rss+xml"/><item><title>Lua Memory That Stops Surprising You</title><link>https://drlongnecker.com/blog/2026/04/lua-memory-optimization-oop-patterns-game-development/</link><pubDate>Tue, 07 Apr 2026 09:00:00 -0600</pubDate><guid>https://drlongnecker.com/blog/2026/04/lua-memory-optimization-oop-patterns-game-development/</guid><description>&lt;p&gt;With my current projects, I&amp;rsquo;m spending a lot of time in Lua 5.4. Get ready for some posts about it as the good, bad, and ugly has been an interesing journey&amp;ndash;not just in the language, but in how the language has modernized in the last few releases.&lt;/p&gt;
&lt;p&gt;Let&amp;rsquo;s start with something that I could nearly ignore in C# and javascript: &lt;strong&gt;garbage collection&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Lua&amp;rsquo;s garbage collector doesn&amp;rsquo;t announce itself. It waits until the heap crosses a threshold, then pauses execution while it sweeps. In a local system or editor, that pause is invisible. In a game running at 60 frames per second, a 16ms budget per frame means any GC pause over a few milliseconds shows up as a hitch the player feels. Worse is server side code and that 16ms hits hundreds of clients at once.&lt;/p&gt;</description></item></channel></rss>