Speed, caching and housekeeping

What re-runs cost, and how to keep a library from growing forever.

Speed

Synthesis runs at roughly 4.6× realtime on an M-series Mac with af_heart.

It is also cached per chunk, keyed on the text, the voice, the speed and the model. Re-running a document you edited re-synthesizes only what changed: a 22-minute paper re-renders in 8 seconds instead of 4 minutes 54.

That is what makes the edit-and-republish loop in The pipeline practical.

earmark audio paper.pdf --dry-run    # chunk count and duration, no synthesis
earmark audio paper.pdf --no-cache   # ignore and don't write the cache
earmark audio paper.pdf --refresh    # re-extract and re-synthesize from scratch

The cache trims itself after every audio run: entries untouched for 90 days go, and the least recently used go after that if it passes 2 GB. It lives with your application data, not in the library.

earmark config --show prints where the cache and the model actually are.

Housekeeping

earmark feed --check                  # do the published URLs actually serve?
earmark feed --rebuild                # rewrite feed.xml and the cover
earmark feed --remove                 # pick episodes off the list and delete them
earmark feed --prune --keep 20        # drop all but the newest 20
earmark feed --prune --max-size 800MB
earmark feed --prune --orphans        # delete files the feed no longer lists

There are two ways to take something off the feed, and they answer different questions. --remove is “not that one” – it deletes the document, audio and Markdown together. --prune is “keep the newest twenty”, and it keeps the Markdown so a dropped episode is cheap to bring back.

--remove

earmark feed prints a numbered list, and --remove reads from it. With no argument it prints that list and asks:

$ earmark feed --remove
1  2026-08-23   0:22:14    10.4 MB  Attention Is All You Need
2  2026-08-19   0:11:02     5.2 MB  A Mathematical Theory of Communication

remove which? (numbers, ranges or titles; blank to cancel) 2

removing:
  A Mathematical Theory of Communication
    audio/a-mathematical-theory-of-communication.mp3
    text/a-mathematical-theory-of-communication.md
delete 1 episode(s) and those files? [y/N] y

It names every file before it asks, because the Markdown is the half you may have edited by hand.

The answer takes numbers, ranges and titles together: 1, 3-5, attention. A title matches without its punctuation or its capitals, so enough of it to be unambiguous will do.

Naming them up front skips the list but still shows what matched before deleting:

earmark feed --remove "Attention Is All You Need"
earmark feed --remove 2 5
earmark feed --remove attention --yes     # no question asked

Nothing survives in the library, so bringing a document back means running earmark publish on the original PDF or URL again. Keep it if you only want it off the feed for now – --prune does that.

--prune

--prune needs one of --keep or --max-size; it will not guess.

--orphans

Pruning an episode removes it from the feed. --orphans goes further and deletes library files the feed no longer lists: the leftover MP3s from episodes that have already been dropped.

It is the one destructive flag here, so it only runs alongside --prune. cover.jpg is never treated as an orphan.

Rebuilding

--rebuild rewrites feed.xml and the cover from the current settings without re-synthesizing anything. Run it after changing a title, an author, a description, or the cover image.

Full flag list: earmark feed.