cd /news/developer-tools/rayfast-a-167-kb-macos-launcher-usin… · home › topics › developer-tools › article
[ARTICLE · art-175955] src=adagradschool.com ↗ pub= topic=developer-tools verified=true sentiment=↑ positive

Rayfast: A 167 KB macOS launcher using about 12 MB at rest

A developer built rayfast, a 167 KB macOS launcher written in plain Objective-C, after having Codex and Claude Code each build a Raycast replacement; rayfast uses about 12 MB of memory at rest versus Raycast's roughly 180 MB and opens in a 50.1 ms median after idle versus Raycast's 95.3 ms, measured on an M5 Mac. Codex's competing QuickKey used about 14 MB at rest and opened in 52.5 ms median, with about 37 ms of each open attributed to the window server taking two 60 Hz refreshes. The author now runs rayfast on ⌘Space and has removed Raycast, citing techniques including re-executing via execv() four seconds after hiding to clear a roughly 10 MB fragmented heap and drawing frames on the CPU into two 1-byte grayscale IOSurfaces.

recommendation

Measure idle and open memory with footprint and vmmap, then disable one feature at a time; re-exec via execv() after hiding to reclaim fragmented heap and avoid AppKit's GPU memory pool by drawing frames into grayscale IOSurfaces.

more in playbook: Running AI in production
by read4 min views4 publishedNov 25, 2026

and the things I learned along the way

I was trying the alpha of Ladybird and noticed how little memory it used. The browser was using less memory than Raycast, which I mostly use to open other apps.

I use Raycast for a few things: hotkeys for common apps, opening apps by name, and short conversions like time zones, units and currency. I don’t use it to resize windows, and I don’t use its AI features. It was using about 230 MB.

I opened Codex and Claude Code and gave both the same task. The launcher had to:

  • meet those functional needs,
  • have a UX similar to Raycast’s,
  • use as little memory as possible when idle,
  • use as little memory as possible when open,
  • take as little time as possible from keypress to first render.

Both kept iterating for a few hours. Codex built QuickKey and Claude built rayfast. Partway through, I gave each one the other’s benchmark results.

Benchmarks #

Both were measured with the same tool, which Codex wrote. It posts the real shortcut and records the screen until the panel matches its finished frame, so the time includes key delivery, the window server and the display refresh. Runs alternated between apps on an M5 Mac.

|  | Raycast | QuickKey (Codex) | rayfast (Claude) | 
|---|---|---|---|

| Open after idle, median | 95.3 ms | 52.5 ms | 50.1 ms | | Rapid reopen, median | 60.6 ms | 46.4 ms | 49.2 ms | | Slowest open | 127 ms | 77.5 ms | 61 ms | | Memory at rest | ~180 MB | ~14 MB | ~12 MB |

QuickKey and rayfast are about even. About 37 ms of each open is the window server taking two 60 Hz refreshes to put a new window on screen, which neither app controls. Each app’s own work is a few milliseconds.

I now use rayfast on ⌘Space and have removed Raycast.

How rayfast keeps memory and latency low #

Claude found most of these by measuring with footprint and vmmap and turning one thing off at a time.

  • Plain Objective-C. No Swift runtime, nibs, web views or Dock icon. The app is a single 167 KB binary.
  • Restarting after each use. After the window closes, the allocator still holds about 10 MB of fragmented memory. Four seconds after the launcher hides, rayfast callsexecv() on itself. It keeps the same process ID and hotkeys and starts with a clean heap.
  • MallocSpaceEfficient=1. This saves about 1 MB. macOS reads it only at process start, so rayfast sets it and re-execs once on launch.
  • No view draws. The open window used 84 MB. About 40 MB was a GPU memory pool that Core Animation gives any window larger than roughly 200×100 that draws through AppKit. The rest grew because drawing a colour gradient on a wide-colour display switched the window to 8-byte float pixels, doubling each buffer. rayfast instead draws each frame on the CPU into two 1-byte grayscale IOSurfaces (about 2.8 MB total) and assigns them to a layer. App icons and the logo are small separate colour layers. The open window now uses about 14 MB.
  • A separate caret layer. The caret blinks with a keyframe animation, so blinking doesn’t redraw the window.
  • Memory-mapped icon cache. Read-only file-backed pages don’t count toward the process footprint, so the 78 KB icon cache costs nothing at rest.
  • Currency rates via /usr/bin/curl. The networking stack is never loaded into the app.
  • A custom search field.NSTextField set up a full text system and cost about 30 ms on a cold open. A small view that handles text input itself is enough for one line and still supports IME and accented characters.
  • Showing the window once at startup. After launch and after each restart, rayfast draws the window and shows it once at zero opacity, off-screen, so macOS’s first-display work is already done.
  • Redrawing on hide. The empty launcher is redrawn right after it closes, so a keypress only has to put the window on screen. This reduced rayfast’s own share of each open from about 17 ms to about 3 ms.

QuickKey uses a similar approach to latency: it stays running with the panel drawn and focused, and frees caches four seconds after it’s dismissed. It keeps one long-running process instead of restarting, which is why it uses a few MB more at rest.

What didn’t help #

Removing the window shadow, changing the window level, forcing an early commit, keeping the window on screen while invisible and further allocator tuning made no measurable difference, so Claude removed them.

An earlier version of rayfast used about 4 MB at rest by the UI only when needed, but the first open took about 70 ms. For reference, a process that does nothing uses about 1 MB on macOS. I preferred faster opens, so that mode was removed.

Code #

rayfast is MIT-licensed: github.com/adagradschool/rayfast. Run make install to install it and start it at login.

── more in #developer-tools 4 stories · sorted by recency
── more on @rayfast 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/rayfast-a-167-kb-mac…] indexed:0 read:4min 2026-11-25 · —